fix: Map Postgres real to FLOAT instead of DOUBLE#6629
Draft
nikolauspschuetz wants to merge 1 commit into
Draft
Conversation
Postgres real is a single-precision float4 column, but pg_type_to_feast_value_type mapped real to ValueType.DOUBLE (and real[] to DOUBLE_LIST), silently widening the inferred schema to float64. The mssql, oracle, and trino type maps in the same module all map real to FLOAT; only Postgres diverged. Map real to FLOAT and real[] to FLOAT_LIST to match. Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
nikolauspschuetz
force-pushed
the
fix-pg-real-float-type-mapping
branch
from
July 22, 2026 21:45
c69419b to
291bee5
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6629 +/- ##
=======================================
Coverage 45.74% 45.74%
=======================================
Files 414 414
Lines 49668 49668
Branches 7078 7078
=======================================
Hits 22723 22723
Misses 25366 25366
Partials 1579 1579
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Postgres
realis a single-precision (float4) column.pg_type_to_feast_value_typemapped it toValueType.DOUBLE(andreal[]toDOUBLE_LIST), silently widening the inferred feature schema to float64:Every other DB type map in the same module maps
realtoFLOAT—mssql_to_feast_value_type,oracle_to_feast_value_type, andtrino_to_feast_value_type. Only the Postgres map diverged. This mapsreal→FLOATandreal[]→FLOAT_LISTto match.Test
Added
test_pg_type_to_feast_value_type_realto the offline unit tests (sdk/python/tests/unit/test_type_map.py); it fails before this change and passes after.