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

fix: Fix case where df.peek would fail to execute even with force=True #511

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

TrevorBergeron
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@TrevorBergeron TrevorBergeron requested review from a team as code owners March 25, 2024 20:00
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Mar 25, 2024
@@ -25,3 +29,12 @@ def is_trivially_executable(node: nodes.BigFrameNode) -> bool:

def local_only(node: nodes.BigFrameNode) -> bool:
return all(isinstance(node, nodes.ReadLocalNode) for node in node.roots)


@functools.cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would this get unwieldy with local data? I worry about that Feather data getting stored forever.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, not sure why I put that cache decorator. Would take a really long time for the cache to get too big though. Removed and will figure out the whole property caching thing later.

@TrevorBergeron TrevorBergeron requested a review from tswast March 26, 2024 01:42
Copy link
Collaborator

@tswast tswast left a comment

Choose a reason for hiding this comment

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

I'm worried about cached behavior and peelable getting out of sync again. Any chance we could refactor to avoid the possibility of the null value after we call cached?

@TrevorBergeron
Copy link
Contributor Author

I'm worried about cached behavior and peelable getting out of sync again. Any chance we could refactor to avoid the possibility of the null value after we call cached?

Added

I'm worried about cached behavior and peelable getting out of sync again. Any chance we could refactor to avoid the possibility of the null value after we call cached?

Now forcing the materialization after caching.

@TrevorBergeron TrevorBergeron requested a review from tswast March 28, 2024 20:02
@tswast tswast merged commit 8eca99a into main Mar 29, 2024
16 checks passed
@tswast tswast deleted the fix_peekable branch March 29, 2024 21:09
Genesis929 pushed a commit that referenced this pull request Apr 9, 2024
#511)

* fix: Fix case where df.peek would fail to execute even with force=True

* remove cache from peekable property

* if force=True always peek after caching even if peeking inefficient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants