From e3e4825f39ae73f9349c8d493bb273c3a7148216 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Mon, 21 Oct 2024 17:29:54 -0700 Subject: [PATCH] simplify print regions --- samples/snippets/filters/filter_snippets.py | 12 +----------- samples/snippets/filters/filter_snippets_async.py | 1 - samples/snippets/reads/read_snippets.py | 12 +----------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/samples/snippets/filters/filter_snippets.py b/samples/snippets/filters/filter_snippets.py index 54c6af0d9..d17c773a4 100644 --- a/samples/snippets/filters/filter_snippets.py +++ b/samples/snippets/filters/filter_snippets.py @@ -13,15 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START bigtable_filters_print] -import datetime - -from google.cloud import bigtable -import google.cloud.bigtable.row_filters as row_filters - -# Write your code here. -# [START_EXCLUDE] - # [START bigtable_filters_limit_row_sample] def filter_limit_row_sample(project_id, instance_id, table_id): @@ -340,9 +331,8 @@ def filter_composing_condition(project_id, instance_id, table_id): # [END bigtable_filters_composing_condition] -# [END_EXCLUDE] - +# [START bigtable_filters_print] def print_row(row): print("Reading data for {}:".format(row.row_key.decode("utf-8"))) for cf, cols in sorted(row.cells.items()): diff --git a/samples/snippets/filters/filter_snippets_async.py b/samples/snippets/filters/filter_snippets_async.py index 6a21f44fb..899d4c5c7 100644 --- a/samples/snippets/filters/filter_snippets_async.py +++ b/samples/snippets/filters/filter_snippets_async.py @@ -365,7 +365,6 @@ async def filter_composing_condition(project_id, instance_id, table_id): # [END bigtable_filters_composing_condition_asyncio] -# [END_EXCLUDE] def print_row(row): diff --git a/samples/snippets/reads/read_snippets.py b/samples/snippets/reads/read_snippets.py index d49966922..210ca73a7 100644 --- a/samples/snippets/reads/read_snippets.py +++ b/samples/snippets/reads/read_snippets.py @@ -13,15 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START bigtable_reads_print] -from google.cloud import bigtable -import google.cloud.bigtable.row_filters as row_filters -from google.cloud.bigtable.row_set import RowSet - -# Write your code here. -# [START_EXCLUDE] - - # [START bigtable_reads_row] def read_row(project_id, instance_id, table_id): from google.cloud import bigtable @@ -152,9 +143,8 @@ def read_filter(project_id, instance_id, table_id): # [END bigtable_reads_filter] -# [END_EXCLUDE] - +# [START bigtable_reads_print] def print_row(row): print("Reading data for {}:".format(row.row_key.decode("utf-8"))) for cf, cols in sorted(row.cells.items()):