-
Notifications
You must be signed in to change notification settings - Fork 48
chore: fix AttributeError when rowiterator has no attribute in g3 #1709
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
base: main
Are you sure you want to change the base?
Conversation
bigframes/session/metrics.py
Outdated
if (row_iterator.total_bytes_processed is None) or ( | ||
row_iterator.query is None | ||
if ( | ||
not hasattr(row_iterator, "total_bytes_processed") |
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.
When was this attribute added? It seems to me this isn't just a "chore: " but a true bug fix for being incompatible with older google-cloud-bigquery library.
Please add a unit test and make sure it fails on at least one nox session before this fix is added.
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.
Actually, the version is very old internally. I still think it'd be good to make sure we have tested against this version, but that might be too much for this PR.
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.
As we discussed offline, this change is not necessary for github because the setup.py
asks google-cloud-bigquery>=3.31.0
, but only needed for g3, which has lower version. The alternative solution would upgrade g3 version and this PR can be a short-term solution to unblock BF g3 import.
bigframes/session/metrics.py
Outdated
if (row_iterator.total_bytes_processed is None) or ( | ||
row_iterator.query is None | ||
if ( | ||
not hasattr(row_iterator, "total_bytes_processed") |
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.
Actually, the version is very old internally. I still think it'd be good to make sure we have tested against this version, but that might be too much for this PR.
Co-authored-by: Tim Sweña (Swast) <[email protected]>
bd07fec
to
7c38439
Compare
7c38439
to
a179898
Compare
When updating BigQuery DataFrames in g3, an
AttributeError
occurs when accessing thetotal_bytes_processed
andquery
attributes of RowIterator. This is because g3 does not have an up-to-date Python client library. Here is the error message: https://screenshot.googleplex.com/4GhbZBdFZrVrCwA