Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
b2cc986 to
2f38847
Compare
luc-pimentel
left a comment
There was a problem hiding this comment.
Thanks for picking up the issue I opened. I ran its reproduction against this PR's current head: the Arrow type strings as FileSource reads them from a pandas-written Parquet file, a schema-less feast apply on a file holding one such column, and the CLI repro from the issue.
| pandas column | Arrow type read | master | this PR |
|---|---|---|---|
datetime.date values |
date32[day] |
KeyError |
applied as UnixTimestamp |
category dtype |
dictionary<values=string, indices=int8, ordered=0> |
KeyError |
applied as String |
Decimal values |
decimal128(3, 2) |
KeyError |
applied as Decimal |
| int64, float64, str, bytes, list of int (controls) | int64, double, string, binary, list<element: int64> |
applied | applied, same types |
The issue's feast apply repro exits 0 here and registers trips: Int64 and signup_date: UnixTimestamp; on master it exits 1 with KeyError: 'date32[day]'. decimal256, large_binary and halffloat columns map as well. time32, time64, duration and a polars-written large_list column now fail with the new error naming the column and the Arrow type instead of the bare KeyError, which is what the issue asked for as the fallback. The DataFrame inference path gives the same types as before.
Tested with Python 3.11, pandas 2.3.3, pyarrow 25.0.1 and polars 2.1.0 on 2026-10-26.
Looks good to me. Curious what the maintainers think.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7043 +/- ##
==========================================
+ Coverage 52.45% 52.77% +0.32%
==========================================
Files 459 459
Lines 58172 58262 +90
Branches 8577 8599 +22
==========================================
+ Hits 30515 30750 +235
+ Misses 25573 25414 -159
- Partials 2084 2098 +14
... and 10 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…ame on inference failure (feast-dev#7040) Signed-off-by: Mrun25 <165297479+Mrun25@users.noreply.github.com>
54fcf16 to
f2829bd
Compare
franciscojavierarceo
left a comment
There was a problem hiding this comment.
we need to narrow the optional lookup before assigning it to value_type so lint-python can pass.
| "list<element: float>": ValueType.FLOAT_LIST, | ||
| } | ||
| value_type = type_map[pa_type_as_str] | ||
| value_type = type_map.get(pa_type_as_str) |
There was a problem hiding this comment.
value_type is already inferred as ValueType, but type_map.get(...) returns ValueType | None, so this assignment fails mypy and keeps lint-python red on this head (CI log). we should assign the lookup to a separate local, check it for None, and then assign the narrowed value to value_type.
Signed-off-by: Mrunmayee Daware <165297479+Mrun25@users.noreply.github.com>
b9e913f to
dfdef02
Compare
There was a problem hiding this comment.
Devin Review found 1 potential issue.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| elif pa_type_as_str.startswith("date32") or pa_type_as_str.startswith("date64"): | ||
| # Mirror the DataFrame inference path, which maps "date" to UNIX_TIMESTAMP. | ||
| value_type = ValueType.UNIX_TIMESTAMP |
There was a problem hiding this comment.
🟡 Inferred date lists fail during materialization
For list<item: date32[day]>, pa_to_feast_value_type now infers UNIX_TIMESTAMP_LIST, but materialization rejects nonempty date lists. _sanitize_list_value converts elements into datetime.date objects, which timestamp-list validation rejects.
Learn more
The existing list parser unwraps list<item: date32[day]>, so the new date32 branch also enables inference of date-list features. Materialization supplies Arrow columns as numpy arrays through _columns_to_proto_values. For a date32 list, _sanitize_list_value calls tolist() on the inner numpy array and produces Python datetime.date values. _convert_list_values_to_proto then validates those values against the timestamp-list types, which exclude datetime.date, and raises a runtime TypeError.
Example: A pandas frame containing {"dates": [[date(2026, 11, 1)]]} written with to_parquet(..., use_compliant_nested_type=False) exposes list<item: date32[day]>. Inference now succeeds, but serializing the retrieved Arrow column raises TypeError: Value "2026-11-01" is of type <class 'datetime.date'> not of type <class 'numpy.datetime64'>.
Recommended fix: Normalize date32 list elements to supported midnight-UTC datetime values before validation and serialization, or extend both timestamp-list validation and timestamp conversion to handle datetime.date. Add a regression test that infers the schema from a real date32-list column and passes its Arrow-to-numpy values through python_values_to_proto_values.
Was this helpful? React with 👍 or 👎 to provide feedback.
Fixes #7040.
A Parquet file written by pandas fails as a batch source: pa_to_feast_value_type raises a bare KeyError for Arrow types pandas commonly writes (date32/date64, decimal128/256, dictionary-encoded categories, halffloat, large_binary), even though the DataFrame inference path maps the equivalent pandas dtypes fine.
Changes:
Tests: parametrized mapping tests and a descriptive-error test in tests/unit/test_type_map.py. ruff format and check clean.