Skip to content

Commit

Permalink
chore(docs): update region tag and move sample and test (#1648)
Browse files Browse the repository at this point in the history
* chore: added new region tags to create_table_external_data_configuration.py

* chore: delete test as part of sample migration

* chore: delete sample as part of sample migration

* chore: move sample and test to /snippets/

* chore: update import statement in create_table_external_data_configuration_test.py

* chore: fix import statement in create_table_external_data_configuration_test.py

* chore: update sample location in tables.rst
  • Loading branch information
meredithslota authored Sep 15, 2023
1 parent b930e46 commit 7248f1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/usage/tables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Create an empty table with the
Create a table using an external data source with the
:func:`~google.cloud.bigquery.client.Client.create_table` method:

.. literalinclude:: ../samples/create_table_external_data_configuration.py
.. literalinclude:: ../samples/snippets/create_table_external_data_configuration.py
:language: python
:dedent: 4
:start-after: [START bigquery_create_table_external_data_configuration]
Expand Down Expand Up @@ -313,4 +313,4 @@ Replace the table data with a Parquet file from Cloud Storage:
:language: python
:dedent: 4
:start-after: [START bigquery_load_table_gcs_parquet_truncate]
:end-before: [END bigquery_load_table_gcs_parquet_truncate]
:end-before: [END bigquery_load_table_gcs_parquet_truncate]
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def create_table_external_data_configuration(
) -> None:
"""Create a table using an external data source"""
orig_table_id = table_id
# [START bigquery_query_external_gcs_perm]
# [START bigquery_create_table_external_data_configuration]
# [START bigquery_create_external_table_definition]
from google.cloud import bigquery
Expand All @@ -28,7 +29,9 @@ def create_table_external_data_configuration(
# TODO(developer): Set table_id to the ID of the table to create.
table_id = "your-project.your_dataset.your_table_name"
# [END bigquery_create_table_external_data_configuration]
# [END bigquery_query_external_gcs_perm]
table_id = orig_table_id
# [START bigquery_query_external_gcs_perm]
# [START bigquery_create_table_external_data_configuration]

# TODO(developer): Set the external source format of your table.
Expand Down Expand Up @@ -64,3 +67,4 @@ def create_table_external_data_configuration(
f"Created table with external source format {table.external_data_configuration.source_format}"
)
# [END bigquery_create_table_external_data_configuration]
# [END bigquery_query_external_gcs_perm]
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import typing

from .. import create_table_external_data_configuration
import create_table_external_data_configuration

if typing.TYPE_CHECKING:
import pytest
Expand Down

0 comments on commit 7248f1f

Please sign in to comment.