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

test(python): tighten assert_frame_equal for LazyFrames (don't collect until after the schema has been checked) #11331

Merged

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Sep 26, 2023

Ref: #11287 (comment) (for @stinodego ;)

The act of collecting may resolve the schema before it has been checked, potentially hiding some edge-cases. If given two LazyFrames, only collect after schema verification.

(Also: brings the assert error message formatting a little closer to our newer standard).

…lect until after the schema has been checked)
@github-actions github-actions bot added the internal An internal refactor or improvement label Sep 26, 2023
@alexander-beedie alexander-beedie changed the title tests(python): tighten assert_frame_equal for LazyFrames (don't collect until after the schema has been checked) test(python): tighten assert_frame_equal for LazyFrames (don't collect until after the schema has been checked) Sep 26, 2023
@github-actions github-actions bot added the python Related to Python Polars label Sep 26, 2023
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

Nice - this will help verify our lazy schemas and will even save some compute in the process by not collecting the lazyframes until it's necessary.

I left some minor comments.

py-polars/polars/testing/asserts.py Outdated Show resolved Hide resolved
py-polars/polars/testing/asserts.py Show resolved Hide resolved
py-polars/polars/testing/asserts.py Outdated Show resolved Hide resolved
@ritchie46
Copy link
Member

This is great! This will improve our (semi)static dtype correctness. 👍

@ritchie46 ritchie46 merged commit d6dbed9 into pola-rs:main Sep 27, 2023
12 checks passed
@alexander-beedie alexander-beedie deleted the improve-assert-lazyframes-equal branch September 27, 2023 07:11
romanovacca pushed a commit to romanovacca/polars that referenced this pull request Oct 1, 2023
…ect until after the schema has been checked) (pola-rs#11331)

Co-authored-by: Stijn de Gooijer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants