-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
BigQuery Python Client v0.28.0: num_rows, schema property of a Table returning None and empty list #4373
Comments
Thanks for the report. It appears as though the BigQuery tables.list method only returns a subset of the fields of a table. I see a few potentially sane fixes:
I'll send a note to my contacts on the BigQuery backend team about doing (1), but the most likely fix will be (2). |
I guess there's another option (4) document that only a subset of fields are exposed in the table response objects from the list request. I dislike that option the most, as it leaves a lot of room for confusion. |
I got confirmation from the backend team that (1) is infeasible. Properties like the schema and total rows of the table take much longer to fetch in the backend. The list API call includes only properties which are fast for the backend to fetch. I think I'd like to propose another option (5) Introduce a new type containing this subset of properties. Maybe |
I had (naively, I guess) assumed that this issue was the exact reason |
No, I unfortunately hadn't thought that listing would have some but not all properties. I'm thinking we really do need to introduce a third type. |
Just sent #4427 to add |
Hi,
I am using the BigQuery Python client v0.28.0
Using the bigquery client to list all tables in a dataset using method
list_dataset_tables
, I get an iterator of table references in the dataset. When I try to access thenum_rows
andschema
properties of the Table object it returnsNone
and[]
.But when I access the table using
client.get_table()
I am able to access both the num_rows and schema properties.I am confused since both the methods return a
google.cloud.bigquery.table.Table
object but are inconsistent.Returns None and []
Returns the number of rows and list of schemaFields
Thanks
The text was updated successfully, but these errors were encountered: