Title: fix: Infer the entity timestamp column with the Polars backend by YHC66 · Pull Request #7004 · feast-dev/feast · GitHub
Open Graph Title: fix: Infer the entity timestamp column with the Polars backend by YHC66 · Pull Request #7004 · feast-dev/feast
X Title: fix: Infer the entity timestamp column with the Polars backend by YHC66 · Pull Request #7004 · feast-dev/feast
Description: What this PR does / why we need it: Another small follow-up to #6965 / #6992 for the local compute engine's Polars backend. LocalJoinNode converts context.entity_df to a backend DataFrame and then infers the entity timestamp column from that DataFrame's dtypes: entity_df = self.backend.from_arrow(pa.Table.from_pandas(context.entity_df)) entity_schema = dict(zip(entity_df.columns, entity_df.dtypes)) entity_ts_col = infer_entity_timestamp_column(entity_schema) infer_event_timestamp_from_entity_df falls back to "the only datetime column" when there is no event_timestamp column, and it detects datetime columns with pandas' is_datetime64_any_dtype. That check does not recognise polars dtypes, so with backend: polars an entity_df whose timestamp column has another name raises: EntityTimestampInferenceException: Please provide an entity_df with a column named event_timestamp representing the time of events. The same entity_df works with the pandas backend. context.entity_df is a pandas DataFrame at this point (it is passed to pa.Table.from_pandas on the line above), so the schema for the inference is now taken from it. Nothing changes for the pandas backend. A new parametrized test joins against an entity_df with a ts column on both backends; the polars case uses pytest.importorskip("polars"), so it is skipped where polars isn't installed. Which issue(s) this PR fixes: No existing issue; found while comparing the local nodes' output between the two backends. Checks I've made sure the tests are passing. My commits are signed off (git commit -s) My PR title follows conventional commits format Testing Strategy Unit tests Integration tests Manual tests Testing is not required for this change Local results (Python 3.12): Setup Result master + polars 2.0.0, new test the polars case fails with EntityTimestampInferenceException, the pandas case passes this branch + polars 2.0.0 tests/unit/infra/compute_engines: 196 passed this branch + polars 1.34.0 local/test_nodes.py: 17 passed this branch, polars not installed 192 passed, 4 skipped ruff check, ruff format --check and mypy on local/nodes.py pass. Misc With this in, the join, dedup, filter and aggregation nodes gave the same output on both backends for the inputs I compared (with and without an entity_df, several inputs, TTL and expression filters, the supported aggregation functions).
Open Graph Description: What this PR does / why we need it: Another small follow-up to #6965 / #6992 for the local compute engine's Polars backend. LocalJoinNode converts context.entity_df to a backend DataFrame and t...
X Description: What this PR does / why we need it: Another small follow-up to #6965 / #6992 for the local compute engine's Polars backend. LocalJoinNode converts context.entity_df to a backend DataFrame a...
Opengraph URL: https://github.com/feast-dev/feast/pull/7004
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:54bb452c-912e-379e-05fd-f1d8366112c3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9EFC:262F52:FE6097:14D1CF3:6AFE9831 |
| html-safe-nonce | db9ff94ac9be69057ce8d72c5905aed1757832cebf296fbd112bab8030bbde68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUZDOjI2MkY1MjpGRTYwOTc6MTREMUNGMzo2QUZFOTgzMSIsInZpc2l0b3JfaWQiOiI4NDkwNTE5MzgwOTMxNTQ5MjMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2f09a4b6946da1a4b71015364671ab25b7098007caf307c7fcaac2e7cae4752c |
| hovercard-subject-tag | pull_request:4847041303 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/7004/files |
| twitter:image | https://avatars.githubusercontent.com/u/122972532?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/122972532?s=400&v=4 |
| og:image:alt | What this PR does / why we need it: Another small follow-up to #6965 / #6992 for the local compute engine's Polars backend. LocalJoinNode converts context.entity_df to a backend DataFrame and t... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width