Skip to content

fix: Infer Feast types for pandas-written Parquet and name columns on inference failure - #7043

Open
Mrun25 wants to merge 1 commit into
feast-dev:masterfrom
Mrun25:fix-parquet-schema-inference-7040
Open

Mrun25 wants to merge 1 commit into
feast-dev:masterfrom
Mrun25:fix-parquet-schema-inference-7040

Conversation

@Mrun25

@Mrun25 Mrun25 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

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:

  • Map the additional Arrow types to the same ValueTypes the DataFrame path produces: date32/date64 -> UNIX_TIMESTAMP, decimal128/256 -> DECIMAL, dictionary<...> -> STRING, halffloat -> FLOAT, large_binary -> BYTES.
  • Replace the bare KeyError with a descriptive ValueError naming the Arrow type.
  • Name the offending column when feature/entity inference and offline-store schema inference hit an unsupported type, so the failure points at the actual column.

Tests: parametrized mapping tests and a descriptive-error test in tests/unit/test_type_map.py. ruff format and check clean.

@Mrun25
Mrun25 requested review from a team as code owners October 19, 2026 06:32
@Mrun25
Mrun25 requested review from ejscribner, nquinn408 and shuchu and a balanced review from Copilot and removed request for a team October 19, 2026 06:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Mrun25
Mrun25 force-pushed the fix-parquet-schema-inference-7040 branch from b2cc986 to 2f38847 Compare October 19, 2026 07:45

@luc-pimentel luc-pimentel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Mrun25 Mrun25 changed the title fix: infer Feast types for pandas-written Parquet Arrow types and name the column on inference failure fix: Infer Feast types for pandas-written Parquet and name columns on inference failure Nov 4, 2026
@codecov-commenter

codecov-commenter commented Nov 4, 2026 •

Copy link
Copy Markdown

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

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.46%. Comparing base (ce02644) to head (f2829bd).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
sdk/python/feast/inference.py 60.00% 2 Missing ⚠️
...python/feast/infra/offline_stores/offline_utils.py 50.00% 2 Missing ⚠️
❗ 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    #7043   +/-   ##
=======================================
  Coverage   52.45%   52.46%           
=======================================
  Files         459      459           
  Lines       58172    58192   +20     
  Branches     8577     8583    +6     
=======================================
+ Hits        30515    30530   +15     
- Misses      25573    25577    +4     
- Partials     2084     2085    +1     
Flag Coverage Δ
go-feature-server 30.96% <ø> (ø)
python-unit 53.97% <81.81%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/type_map.py 66.86% <100.00%> (+0.47%) ⬆️
sdk/python/feast/inference.py 68.57% <60.00%> (-0.32%) ⬇️
...python/feast/infra/offline_stores/offline_utils.py 74.61% <50.00%> (-0.64%) ⬇️

... and 1 file with indirect coverage changes


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 ce02644...f2829bd. 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.

@ntkathole
ntkathole force-pushed the fix-parquet-schema-inference-7040 branch from 54fcf16 to f2829bd Compare November 13, 2026 14:03

This branch has not been deployed

No deployments
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.

Feature inference on a Parquet FileSource raises KeyError for date, categorical and decimal columns

4 participants