FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Map Postgres real to FLOAT instead of DOUBLE by nikolauspschuetz · Pull Request #6629 · feast-dev/feast · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions sdk/python/feast/type_map.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,7 @@ def pg_type_to_feast_value_type(type_str: str) -> ValueType:
"bigint": ValueType.INT64,
"smallint": ValueType.INT32,
"integer": ValueType.INT32,
"real": ValueType.DOUBLE,
"real": ValueType.FLOAT,
"double precision": ValueType.DOUBLE,
"boolean[]": ValueType.BOOL_LIST,
"bytea[]": ValueType.BYTES_LIST,
Expand All @@ -2058,7 +2058,7 @@ def pg_type_to_feast_value_type(type_str: str) -> ValueType:
"text[]": ValueType.STRING_LIST,
"character[]": ValueType.STRING_LIST,
"bigint[]": ValueType.INT64_LIST,
"real[]": ValueType.DOUBLE_LIST,
"real[]": ValueType.FLOAT_LIST,
"double precision[]": ValueType.DOUBLE_LIST,
"character": ValueType.STRING,
"character varying": ValueType.STRING,
Expand Down
5 changes: 5 additions & 0 deletions sdk/python/tests/unit/test_type_map.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ def test_pg_type_to_feast_value_type_json_array(self):
assert pg_type_to_feast_value_type("json[]") == ValueType.MAP_LIST
assert pg_type_to_feast_value_type("jsonb[]") == ValueType.MAP_LIST

def test_pg_type_to_feast_value_type_real(self):
"""Postgres real is single-precision (float4), so it maps to FLOAT, not DOUBLE."""
assert pg_type_to_feast_value_type("real") == ValueType.FLOAT
assert pg_type_to_feast_value_type("real[]") == ValueType.FLOAT_LIST

def test_snowflake_variant_to_map(self):
"""Test that Snowflake VARIANT/OBJECT types convert to ValueType.MAP."""
assert snowflake_type_to_feast_value_type("VARIANT") == ValueType.MAP
Expand Down
Loading

Back | FazBrowse Home | New Git URL