Uh oh!
There was an error while loading. Please reload this page.
feat: detect obsolete BQ Storage extra at runtime - #666
Conversation
plamut
commented
May 18, 2021
Will fix the coverage error son, one line not hit by the tests. |
jimfulton
left a comment
There was a problem hiding this comment.
I think we can be a little DRYer if we reuse _create_bqstorage_client more after adding some arguments to it.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
plamut
commented
May 18, 2021
Sounds reasonable, I'll probably give it a shot. 👍 |
jimfulton
commented
May 18, 2021
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. |
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.listin most cases (a warning is emitted instead of raising an error).