-
Notifications
You must be signed in to change notification settings - Fork 322
Description
Is your feature request related to a problem? Please describe.
Currently, the document on creating a table is clear on how to initialize a Table object with a specific fields schema. For example, here is a code snippet from the docs:
However, a challenge I faced with these docs is knowing how to create a Table with, e.g., an ExternalConfig set.
Based on the source for Table / unit tests, is the correct approach using a property setter?:
from google.cloud import bigquery
client bigquery.Client()
table = bigquery.Table(...)
# use property setter
table.external_data_configuration = bigquery.ExternalConfig(...)
# edit: it looks like ExternalConfig also needs to use setters, so might include, e.g..
external_config = bigquery.ExternalConfig("NEWLINE_DELIMITED_JSON")
external_config.source_uris = [...]Describe the solution you'd like
Can we add an example to the docs so that readers learn these two pieces?:
- Table attributes like schema can be set on
__init__(or via setters) - Other Table attributes must be set using setters
It seems like two places users may look for this info is in the Table API doc, and in the usage/tables - creating a table doc. Also, apologies if it's already somewhere in the docs and I missed it 😅.
Describe alternatives you've considered
Since Table can be constructed using .from_api_repr(), I wondered if this is a more common approach for construction? In that case it seems like having a nudge in the docs on using this path for e.g. constructing an external table would be super helpful!
