-
Notifications
You must be signed in to change notification settings - Fork 50
chore: prevent location warning when _read_gbq_colab
can determine the location
#1802
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e location I've made some updates to prevent a location warning when the system can determine the location for `bigframes.pandas.io.api._read_gbq_colab`. I've updated `bigframes.pandas.io.api._read_gbq_colab` so it correctly calls `bigframes.session.Session._read_gbq_colab` and adjusted its arguments. The `_read_gbq_colab` function in the pandas API layer now has a simpler signature, accepting `query_or_table`, `pyformat_args`, and `dry_run`. It will continue to call `_set_default_session_location_if_possible` to prevent location warnings. I've also updated the unit tests to reflect these changes, making sure that the correct session-level function is called and that arguments are passed through as expected. I've also moved the tests to `tests/unit/pandas/io/test_api.py` and converted them to pytest style to follow our repository conventions.
70affa0
to
c6df394
Compare
tswast
commented
Jun 9, 2025
Genesis929
previously approved these changes
Jun 10, 2025
tswast
commented
Jun 10, 2025
bigframes/pandas/io/api.py
Outdated
Union[bigframes.dataframe.DataFrame, pandas.Series]: | ||
A BigQuery DataFrame if `dry_run` is False, otherwise a pandas Series. | ||
""" | ||
_set_default_session_location_if_possible(query_or_table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the first query has any format variables, the dry run could fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to run pyformat first.
3 tasks
Genesis929
approved these changes
Jun 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in
67E3
to comment
Labels
api: bigquery
Issues related to the googleapis/python-bigquery-dataframes API.
size: m
Pull request size is medium.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…can determine the location for
bigframes.pandas.io.api._read_gbq_colab
.I've updated
bigframes.pandas.io.api._read_gbq_colab
so it correctly callsbigframes.session.Session._read_gbq_colab
and adjusted its arguments.The
_read_gbq_colab
function in the pandas API layer now has a simpler signature, acceptingquery_or_table
,pyformat_args
, anddry_run
. It will continue to call_set_default_session_location_if_possible
to prevent location warnings.I've also updated the unit tests to reflect these changes, making sure that the correct session-level function is called and that arguments are passed through as expected. I've also moved the tests to
tests/unit/pandas/io/test_api.py
and converted them to pytest style to follow our repository conventions.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:
Fixes internal issue b/423657977 🦕