8000 Call get_table automatically in list_rows if the schema is not available by tswast · Pull Request #7621 · googleapis/google-cloud-python · GitHub
[go: up one dir, main page]

Skip to content

Conversation

tswast
Copy link
Contributor
@tswast tswast commented Mar 30, 2019

This is kinder than raising an error message saying to call get_table
yourself. Also, it guarantees the schema is as up-to-date as possible.

This also fixes an issue where rows could not be listed on the
TableListItem objects that are returned from list_tables.

This is kinder than raising an error message saying to call get_table
yourself. Also, it guarantees the schema is as up-to-date as possible.

This also fixes an issue where rows could not be listed on the
TableListItem objects that are returned from list_tables.
@tswast tswast added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: bigquery Issues related to the BigQuery API. labels Mar 30, 2019
@tswast tswast requested a review from crwilcox as a code owner March 30, 2019 00:31
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 30, 2019
# columns, so get the table resource for them rather than failing.
elif len(schema) == 0:
table = self.get_table(table.reference, retry=retry)
schema = table.schema
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing the extra API round-trip is certainly friendlier, but it makes the programming error more expensive (in time / billing). I guess that is a reasonable tradeoff.

@tswast tswast merged commit 019e905 into googleapis:master Apr 1, 2019
@tswast tswast deleted the list_rows-get_table branch December 27, 2019 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0