Skip to content

refactor: Extract DataFrame execution to class #899

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

Merged
merged 9 commits into from
Aug 16, 2024
Merged

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> 🦕

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Aug 14, 2024
@TrevorBergeron TrevorBergeron marked this pull request as ready for review August 14, 2024 19:57
@TrevorBergeron TrevorBergeron requested review from a team as code owners August 14, 2024 19:57
@TrevorBergeron TrevorBergeron requested a review from shobsi August 14, 2024 19:57
@TrevorBergeron TrevorBergeron requested review from chelsea-lin and removed request for shobsi August 14, 2024 19:57
_MAX_CLUSTER_COLUMNS = 4


class BigQueryCachingExecutor:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add some comments to briefly explain how the cached executions works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a bit of an explantation to class description.

@@ -222,17 +223,17 @@ def add_labels(job_config, api_name: Optional[str] = None):


def start_query_with_client(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make the Session as a class and then bq_client and metrics can be part of it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would rather pass more precise context, this makes it more flexible for use in other places, and reduces circular dependency between files.

Copy link
Contributor

@chelsea-lin chelsea-lin left a comment

Choose a reason for hiding this comment

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

Thanks for improving code readability consistently.

@TrevorBergeron TrevorBergeron enabled auto-merge (squash) August 16, 2024 00:37
@TrevorBergeron TrevorBergeron merged commit 92fdb93 into main Aug 16, 2024
22 of 23 checks passed
@TrevorBergeron TrevorBergeron deleted the executor branch August 16, 2024 17:01
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: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants