Skip to content

Commit 7248f1f

Browse files
chore(docs): update region tag and move sample and test (#1648)
* 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
1 parent b930e46 commit 7248f1f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

docs/usage/tables.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Create an empty table with the
6161
Create a table using an external data source with the
6262
:func:`~google.cloud.bigquery.client.Client.create_table` method:
6363

64-
.. literalinclude:: ../samples/create_table_external_data_configuration.py
64+
.. literalinclude:: ../samples/snippets/create_table_external_data_configuration.py
6565
:language: python
6666
:dedent: 4
6767
:start-after: [START bigquery_create_table_external_data_configuration]
@@ -313,4 +313,4 @@ Replace the table data with a Parquet file from Cloud Storage:
313313
:language: python
314314
:dedent: 4
315315
:start-after: [START bigquery_load_table_gcs_parquet_truncate]
316-
:end-before: [END bigquery_load_table_gcs_parquet_truncate]
316+
:end-before: [END bigquery_load_table_gcs_parquet_truncate]

samples/create_table_external_data_configuration.py renamed to samples/snippets/create_table_external_data_configuration.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def create_table_external_data_configuration(
1818
) -> None:
1919
"""Create a table using an external data source"""
2020
orig_table_id = table_id
21+
# [START bigquery_query_external_gcs_perm]
2122
# [START bigquery_create_table_external_data_configuration]
2223
# [START bigquery_create_external_table_definition]
2324
from google.cloud import bigquery
@@ -28,7 +29,9 @@ def create_table_external_data_configuration(
2829
# TODO(developer): Set table_id to the ID of the table to create.
2930
table_id = "your-project.your_dataset.your_table_name"
3031
# [END bigquery_create_table_external_data_configuration]
32+
# [END bigquery_query_external_gcs_perm]
3133
table_id = orig_table_id
34+
# [START bigquery_query_external_gcs_perm]
3235
# [START bigquery_create_table_external_data_configuration]
3336

3437
# TODO(developer): Set the external source format of your table.
@@ -64,3 +67,4 @@ def create_table_external_data_configuration(
6467
f"Created table with external source format {table.external_data_configuration.source_format}"
6568
)
6669
# [END bigquery_create_table_external_data_configuration]
70+
# [END bigquery_query_external_gcs_perm]

samples/tests/test_create_table_external_data_configuration.py renamed to samples/snippets/create_table_external_data_configuration_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import typing
1616

17-
from .. import create_table_external_data_configuration
17+
import create_table_external_data_configuration
1818

1919
if typing.TYPE_CHECKING:
2020
import pytest

0 commit comments

Comments
 (0)