Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query expression preflighting now prohibits crossing nests. #165

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

gitosaurus
Copy link
Contributor

Doing so never worked, but now it is correctly detected.

Resolves #160 .

Change Description

  • My PR includes a link to the issue that I am addressing

Solution Description

The expression-tree scanning that was done before is now expanded so that it not only notices the use of nests, but tracks the nest columns' identifiers.

Code Quality

  • I have read the Contribution Guide
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

Project-Specific Pull Request Checklists

Bug Fix Checklist

  • My fix includes a new test that breaks as a result of the bug (if possible)
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

Doing so never worked, but now it is correctly detected.
@gitosaurus gitosaurus linked an issue Oct 31, 2024 that may be closed by this pull request
3 tasks
@gitosaurus gitosaurus requested review from hombit and wilsonbb October 31, 2024 00:25
Copy link

github-actions bot commented Oct 31, 2024

Before [d379665] After [e53169f] Ratio Benchmark (Parameter)
30.4±6ms 46.5±8ms ~1.53 benchmarks.ReassignHalfOfNestedSeries.time_run
22.1±0.2ms 23.7±0.1ms 1.07 benchmarks.AssignSingleDfToNestedSeries.time_run
88.1M 88.5M 1.01 benchmarks.NestedFrameAddNested.peakmem_run
266M 266M 1.00 benchmarks.AssignSingleDfToNestedSeries.peakmem_run
93.2M 93.2M 1.00 benchmarks.NestedFrameQuery.peakmem_run
7.99±0.04ms 7.99±0.1ms 1.00 benchmarks.NestedFrameQuery.time_run
91.8M 91.8M 1.00 benchmarks.NestedFrameReduce.peakmem_run
1.61±0.01ms 1.62±0.01ms 1.00 benchmarks.NestedFrameReduce.time_run
285M 285M 1.00 benchmarks.ReassignHalfOfNestedSeries.peakmem_run
9.85±0.1ms 9.57±0.1ms 0.97 benchmarks.NestedFrameAddNested.time_run

Click here to view all benchmarks.

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.49%. Comparing base (b8707a9) to head (a03b23b).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #165   +/-   ##
=======================================
  Coverage   99.49%   99.49%           
=======================================
  Files          14       14           
  Lines         984      985    +1     
=======================================
+ Hits          979      980    +1     
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@wilsonbb wilsonbb left a comment

Choose a reason for hiding this comment

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

Overall it looks pretty good, but I am a bit confused by a part of _actionable_splits. Can check again in the morning.

src/nested_pandas/nestedframe/utils.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/utils.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@hombit hombit left a comment

Choose a reason for hiding this comment

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

Could you please add a higher level test checking that an example from #160 fails?

src/nested_pandas/nestedframe/utils.py Outdated Show resolved Hide resolved
src/nested_pandas/nestedframe/utils.py Outdated Show resolved Hide resolved
@gitosaurus
Copy link
Contributor Author

Could you please add a higher level test checking that an example from #160 fails?

Done!

@gitosaurus gitosaurus merged commit 1a2a1d2 into main Oct 31, 2024
10 checks passed
@gitosaurus gitosaurus deleted the prohibit-cross-nest-queries-160 branch October 31, 2024 20:01
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.

Cross-nest queries in NestedFrame.query should be prohibited or split
3 participants