Skip to content

fix: Map Postgres real to FLOAT instead of DOUBLE#6629

Draft
nikolauspschuetz wants to merge 1 commit into
feast-dev:masterfrom
nikolauspschuetz:fix-pg-real-float-type-mapping
Draft

fix: Map Postgres real to FLOAT instead of DOUBLE#6629
nikolauspschuetz wants to merge 1 commit into
feast-dev:masterfrom
nikolauspschuetz:fix-pg-real-float-type-mapping

Conversation

@nikolauspschuetz

Copy link
Copy Markdown
Contributor

What this does

Postgres real is a single-precision (float4) column. pg_type_to_feast_value_type mapped it to ValueType.DOUBLE (and real[] to DOUBLE_LIST), silently widening the inferred feature schema to float64:

from feast.type_map import pg_type_to_feast_value_type
pg_type_to_feast_value_type("real")    # -> ValueType.DOUBLE   (should be FLOAT)
pg_type_to_feast_value_type("real[]")  # -> ValueType.DOUBLE_LIST (should be FLOAT_LIST)

Every other DB type map in the same module maps real to FLOATmssql_to_feast_value_type, oracle_to_feast_value_type, and trino_to_feast_value_type. Only the Postgres map diverged. This maps realFLOAT and real[]FLOAT_LIST to match.

Test

Added test_pg_type_to_feast_value_type_real to the offline unit tests (sdk/python/tests/unit/test_type_map.py); it fails before this change and passes after.

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
nikolauspschuetz force-pushed the fix-pg-real-float-type-mapping branch from c69419b to 291bee5 Compare July 22, 2026 21:45
@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.74%. Comparing base (54da19a) to head (291bee5).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           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           
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 47.01% <ø> (ø)
Files with missing lines Coverage Δ
sdk/python/feast/type_map.py 63.12% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54da19a...291bee5. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants