Skip to content

BigQuery Python Client v0.28.0: num_rows, schema property of a Table returning None and empty list #4373

Closed
@pramodvspk

Description

@pramodvspk

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 the num_rows and schema properties of the Table object it returns None 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.

for table in bqclient.list_dataset_tables(dataset_ref):
	print(table.num_rows)
	print(table.schema)

Returns None and []

table = bqclient.get_table(table)
	print(table.num_rows)
	print(table.schema)

Returns the number of rows and list of schemaFields

Thanks

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions