Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

test: fix snippets test of using partial ordering mode #1741

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 2 commits into from
May 16, 2025
Merged

Conversation

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

@GarrettWu GarrettWu requested review from tswast and shuoweil May 15, 2025 22:32
@GarrettWu GarrettWu self-assigned this May 15, 2025
@GarrettWu GarrettWu requested review from a team as code owners May 15, 2025 22:32
@GarrettWu GarrettWu requested a review from iennae May 15, 2025 22:32
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. samples Issues that are directly related to samples. labels May 15, 2025
@GarrettWu GarrettWu requested a review from shobsi May 15, 2025 22:33
@@ -34,3 +34,6 @@ def test_quickstart(
quickstart.run_quickstart(your_project_id)
out, _ = capsys.readouterr()
assert "average_body_mass:" in out

# close session so not to affect other tests
bigframes.pandas.close_session()
Copy link
Contributor

@shobsi shobsi May 15, 2025

Choose a reason for hiding this comment

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

If the objective is to reset the partially ordered mode to default ordering, I'm afraid that would not happen here, as the value set stills lingers on, and picked up by the next session created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right. reset the option and moved to run_quickstart() where the option is changed.

@GarrettWu GarrettWu requested a review from shobsi May 15, 2025 22:53
@GarrettWu GarrettWu enabled auto-merge (squash) May 16, 2025 00:16
@@ -71,3 +71,7 @@ def run_quickstart(project_id: str) -> None:
model.fit(X, y)
model.score(X, y)
# [END bigquery_bigframes_quickstart]

Copy link
Contributor

Choose a reason for hiding this comment

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

This is better approach, thanks!. For additional sanity let's restore the original ordering mode. (The reason for this PR is because multiple tests are sharing the global session, in which case we give back what we got).

    original_ordering_mode = bpd.options.bigquery.ordering_mode

    # [START bigquery_bigframes_quickstart]
    ...
    # [END bigquery_bigframes_quickstart]
    bpd.close_session()
    bpd.options.bigquery.ordering_mode = original_ordering_mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lemme know what you think about #1743

@GarrettWu GarrettWu merged commit d937be0 into main May 16, 2025
24 checks passed
@GarrettWu GarrettWu deleted the garrettwu-fix branch May 16, 2025 00:32
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. samples Issues that are directly related to samples. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.