Repository navigation
Conversation
LocalJoinNode inferred the entity timestamp column from the dtypes of the backend DataFrame. The inference only recognises pandas datetime dtypes, so with the Polars backend an entity_df whose timestamp column is not named event_timestamp raised EntityTimestampInferenceException. Infer it from the pandas entity_df instead. Signed-off-by: Yihang Chen <yhc0720@berkeley.edu>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7004 +/- ##
==========================================
- Coverage 51.02% 51.01% -0.02%
==========================================
Files 452 452
Lines 56728 56728
Branches 8265 8265
==========================================
- Hits 28946 28937 -9
- Misses 25801 25809 +8
- Partials 1981 1982 +1
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Another small follow-up to #6965 / #6992 for the local compute engine's Polars backend.
LocalJoinNodeconvertscontext.entity_dfto a backend DataFrame and then infers the entity timestamp column from that DataFrame's dtypes:infer_event_timestamp_from_entity_dffalls back to "the only datetime column" when there is noevent_timestampcolumn, and it detects datetime columns with pandas'is_datetime64_any_dtype. That check does not recognise polars dtypes, so withbackend: polarsanentity_dfwhose timestamp column has another name raises:The same
entity_dfworks with the pandas backend.context.entity_dfis a pandas DataFrame at this point (it is passed topa.Table.from_pandason 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_dfwith atscolumn on both backends; the polars case usespytest.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
git commit -s)Testing Strategy
Local results (Python 3.12):
EntityTimestampInferenceException, the pandas case passestests/unit/infra/compute_engines: 196 passedlocal/test_nodes.py: 17 passedruff check,ruff format --checkandmypyonlocal/nodes.pypass.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).