-
Notifications
You must be signed in to change notification settings - Fork 308
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
feat: detect obsolete BQ Storage extra at runtime #666
Conversation
Will fix the coverage error son, one line not hit by the tests. |
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.
I think we can be a little DRYer if we reuse _create_bqstorage_client
more after adding some arguments to it.
Sounds reasonable, I'll probably give it a shot. 👍 |
I'm proposing that
and maybe gets renamed :) and that it's called even when the caller is given a client. If the library is out of date, the caller will end up with |
The method is renamed to _ensure_bqstorage_client() and now performs a check if BQ Storage dependency is recent enough.
The check is now performed in dbapi.Connection, which is sufficient.
The methods in higher layers already do the same check before a BQ Storage client instance is passed to _pandas_helpers._download_table_bqstorage() helper.
Lean more heavily on client._ensure_bqstorage_client() to de-duplicate logic.
I checked the call chains and if I didn't miss anything, the only place left where a bad BQ Storage client could leak down is
Refactored Apart from the client's factory, the other central place where we check if BQ Storage client is compatible is Edit: Will fix the two coverage misses tomorrow. |
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.
LGTM
Closes #629.
This PR adds logic to detect obsolete versions of BQ Storage extra and emit a warning or raise an error where applicable.
Traced all BQ Storage-related code and call paths and I think the changes here cover them all. As a bonus, we get a graceful fallback to
tabledata.list
in most cases (a warning is emitted instead of raising an error).