google-cloud-bigtable 2.45.0__tar.gz → 2.46.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google_cloud_bigtable-2.45.0/google_cloud_bigtable.egg-info → google_cloud_bigtable-2.46.0}/PKG-INFO +1 -1
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_async/_read_rows.py +2 -2
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_helpers.py +48 -1
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_sync_autogen/_read_rows.py +5 -3
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/exceptions.py +2 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/gapic_version.py +1 -1
- google_cloud_bigtable-2.46.0/google/cloud/bigtable/helpers.py +62 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/row.py +18 -0
- google_cloud_bigtable-2.46.0/google/cloud/bigtable/row_data.py +220 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/row_filters.py +1 -29
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/row_set.py +37 -67
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/table.py +51 -39
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin/__init__.py +12 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin/gapic_version.py +1 -1
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/__init__.py +12 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/gapic_metadata.json +45 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/gapic_version.py +1 -1
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py +397 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py +406 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py +160 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py +45 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py +88 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py +104 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py +685 -22
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py +49 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/types/__init__.py +12 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py +155 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/types/instance.py +112 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/gapic_version.py +1 -1
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0/google_cloud_bigtable.egg-info}/PKG-INFO +1 -1
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google_cloud_bigtable.egg-info/SOURCES.txt +0 -1
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/v2_client/test_data_api.py +44 -15
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_async/test_client.py +21 -5
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_sync_autogen/test_client.py +16 -11
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test__helpers.py +42 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py +6365 -3790
- google_cloud_bigtable-2.46.0/tests/unit/v2_client/test_row_data.py +617 -0
- google_cloud_bigtable-2.46.0/tests/unit/v2_client/test_row_merger.py +57 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_row_set.py +64 -56
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_table.py +93 -462
- google_cloud_bigtable-2.45.0/google/cloud/bigtable/helpers.py +0 -30
- google_cloud_bigtable-2.45.0/google/cloud/bigtable/row_data.py +0 -377
- google_cloud_bigtable-2.45.0/google/cloud/bigtable/row_merger.py +0 -251
- google_cloud_bigtable-2.45.0/tests/unit/v2_client/test_row_data.py +0 -1235
- google_cloud_bigtable-2.45.0/tests/unit/v2_client/test_row_merger.py +0 -230
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/LICENSE +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/MANIFEST.in +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/README.rst +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/app_profile.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/backup.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/batcher.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/cluster.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/column_family.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_async/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_async/_mutate_rows.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_async/_swappable_channel.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_async/client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_async/metrics_interceptor.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_async/mutations_batcher.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_cross_sync/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_cross_sync/_decorators.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_cross_sync/_mapping_meta.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_cross_sync/cross_sync.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_metrics/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_metrics/data_model.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_metrics/handlers/_base.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_metrics/handlers/gcp_exporter.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_metrics/handlers/opentelemetry.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_metrics/metrics_controller.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_metrics/tracked_retry.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_sync_autogen/_swappable_channel.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_sync_autogen/client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_sync_autogen/metrics_interceptor.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/_async/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/_async/execute_query_iterator.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/_byte_cursor.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/_checksum.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/_parameters_formatting.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/_query_result_parsing_utils.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/_reader.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/metadata.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/execute_query/values.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/mutations.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/read_modify_write_rules.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/read_rows_query.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/row.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/row_filters.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/encryption_info.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/enums.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/error.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/instance.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/policy.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/py.typed +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin/py.typed +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/_compat.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/services/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/async_client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/types/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/types/async_consistency.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/types/async_restore_table.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/types/consistency.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/types/restore_table.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/overlay/types/wait_for_consistency_request.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/py.typed +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/types/common.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/types/table.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/types/types.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/utils/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_admin_v2/utils/oneof_message.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/_compat.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/gapic_metadata.json +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/py.typed +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/async_client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/transports/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/transports/base.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/transports/grpc.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/transports/grpc_asyncio.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/transports/rest.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/services/bigtable/transports/rest_base.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/bigtable.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/data.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/feature_flags.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/peer_info.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/request_stats.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/response_params.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/session.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable_v2/types/types.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google_cloud_bigtable.egg-info/dependency_links.txt +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google_cloud_bigtable.egg-info/not-zip-safe +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google_cloud_bigtable.egg-info/requires.txt +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google_cloud_bigtable.egg-info/top_level.txt +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/setup.cfg +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/setup.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/admin_overlay/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/admin_overlay/conftest.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/admin_overlay/test_system_async.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/admin_overlay/test_system_autogen.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/conftest.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/cross_sync/test_cases/async_to_sync.yaml +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/cross_sync/test_cases/cross_sync_files.yaml +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/cross_sync/test_cases/rm_aio.yaml +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/cross_sync/test_cases/strip_async_conditional_branches.yaml +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/cross_sync/test_cases/symbol_replacer.yaml +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/cross_sync/test_cross_sync_e2e.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/data/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/data/test_metrics_async.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/data/test_metrics_autogen.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/data/test_system_async.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/data/test_system_autogen.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/utils.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/v2_client/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/v2_client/_helpers.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/v2_client/conftest.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/v2_client/test_instance_admin.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/system/v2_client/test_table_admin.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/my_oneof_message.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/test_admin_packaging.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/test_async_client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/test_async_consistency.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/test_async_restore_table.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/test_client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/test_consistency.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/test_oneof_message.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/admin_overlay/test_restore_table.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/conftest.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_async/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_async/test__mutate_rows.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_async/test__read_rows.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_async/test__swappable_channel.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_async/test_metrics_interceptor.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_async/test_mutations_batcher.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_async/test_read_rows_acceptance.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_cross_sync/test_cross_sync.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_cross_sync/test_cross_sync_decorators.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_metrics/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_metrics/test_data_model.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_metrics/test_gcp_exporter_handler.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_metrics/test_metrics_controller.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_metrics/test_opentelemetry_handler.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_metrics/test_tracked_retry.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_sync_autogen/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_sync_autogen/test__mutate_rows.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_sync_autogen/test__read_rows.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_sync_autogen/test__swappable_channel.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_sync_autogen/test_metrics_interceptor.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_sync_autogen/test_mutations_batcher.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/_sync_autogen/test_read_rows_acceptance.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/_async/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/_async/test_query_iterator.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/_sync_autogen/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/_sync_autogen/test_query_iterator.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/resources/README.md +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/resources/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/resources/descriptors.pb +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/resources/singer.proto +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/resources/singer_pb2.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/sql_helpers.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/test_byte_cursor.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/test_checksum.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/test_execute_query_parameters_parsing.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/test_metadata.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/test_query_result_parsing_utils.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/execute_query/test_query_result_row_reader.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/read-rows-acceptance-test.json +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test_exceptions.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test_helpers.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test_mutations.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test_read_modify_write_rules.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test_read_rows_query.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test_row.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test_row_filters.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/data/test_sync_up_to_date.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/gapic/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/gapic/bigtable_admin_v2/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/gapic/bigtable_admin_v2/test_compat.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/gapic/bigtable_v2/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/gapic/bigtable_v2/test_bigtable.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/gapic/bigtable_v2/test_compat.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/test_packaging.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/test_sql_routing_parameters.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/__init__.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/_testing.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/read-rows-acceptance-test.json +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_app_profile.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_backup.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_batcher.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_client.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_cluster.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_column_family.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_encryption_info.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_error.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_instance.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_policy.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_row.py +0 -0
- {google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/tests/unit/v2_client/test_row_filters.py +0 -0
|
@@ -18,12 +18,12 @@ from __future__ import annotations
|
|
|
18
18
|
import time
|
|
19
19
|
from typing import TYPE_CHECKING, Sequence
|
|
20
20
|
|
|
21
|
-
from google.api_core import retry as retries
|
|
22
21
|
from grpc import StatusCode
|
|
23
22
|
|
|
24
23
|
from google.cloud.bigtable.data._cross_sync import CrossSync
|
|
25
24
|
from google.cloud.bigtable.data._helpers import (
|
|
26
25
|
_attempt_timeout_generator,
|
|
26
|
+
_rst_stream_aware_predicate,
|
|
27
27
|
)
|
|
28
28
|
from google.cloud.bigtable.data._metrics.tracked_retry import tracked_retry
|
|
29
29
|
from google.cloud.bigtable.data.exceptions import (
|
|
@@ -108,7 +108,7 @@ class _ReadRowsOperationAsync:
|
|
|
108
108
|
else:
|
|
109
109
|
self.request = query._to_pb(target)
|
|
110
110
|
self.target = target
|
|
111
|
-
self._predicate =
|
|
111
|
+
self._predicate = _rst_stream_aware_predicate(*retryable_exceptions)
|
|
112
112
|
self._last_yielded_row_key: bytes | None = None
|
|
113
113
|
self._remaining_count: int | None = self.request.rows_limit or None
|
|
114
114
|
self._operation_metric = metric
|
{google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/data/_helpers.py
RENAMED
|
@@ -20,9 +20,17 @@ from __future__ import annotations
|
|
|
20
20
|
import enum
|
|
21
21
|
import time
|
|
22
22
|
from collections import namedtuple
|
|
23
|
-
from typing import
|
|
23
|
+
from typing import (
|
|
24
|
+
TYPE_CHECKING,
|
|
25
|
+
Callable,
|
|
26
|
+
List,
|
|
27
|
+
Sequence,
|
|
28
|
+
Tuple,
|
|
29
|
+
Union,
|
|
30
|
+
)
|
|
24
31
|
|
|
25
32
|
from google.api_core import exceptions as core_exceptions
|
|
33
|
+
from google.api_core import retry as retries
|
|
26
34
|
from google.api_core.retry import RetryFailureReason, exponential_sleep_generator
|
|
27
35
|
|
|
28
36
|
from google.cloud.bigtable.data.exceptions import RetryExceptionGroup
|
|
@@ -50,6 +58,15 @@ _CONCURRENCY_LIMIT = 10
|
|
|
50
58
|
# used by every data client as a default project name for testing on Bigtable emulator.
|
|
51
59
|
_DEFAULT_BIGTABLE_EMULATOR_CLIENT = "google-cloud-bigtable-emulator"
|
|
52
60
|
|
|
61
|
+
# Internal error messages that can be retried during ReadRows. Internal error messages with this error
|
|
62
|
+
# text should be treated as Unavailable error messages with the same error text, and will therefore be
|
|
63
|
+
# treated as Unavailable errors rather than Internal errors.
|
|
64
|
+
_RETRYABLE_INTERNAL_ERROR_MESSAGES = (
|
|
65
|
+
"rst_stream",
|
|
66
|
+
"rst stream",
|
|
67
|
+
"received unexpected eos on data frame from server",
|
|
68
|
+
)
|
|
69
|
+
|
|
53
70
|
# used to identify an active bigtable resource that needs to be warmed through PingAndWarm
|
|
54
71
|
# each instance/app_profile_id pair needs to be individually tracked
|
|
55
72
|
_WarmedInstanceKey = namedtuple(
|
|
@@ -126,6 +143,36 @@ def _retry_exception_factory(
|
|
|
126
143
|
return source_exc, cause_exc
|
|
127
144
|
|
|
128
145
|
|
|
146
|
+
def _rst_stream_aware_predicate(
|
|
147
|
+
*exception_types: type[Exception],
|
|
148
|
+
) -> Callable[[Exception], bool]:
|
|
149
|
+
"""A custom retry predicate.
|
|
150
|
+
|
|
151
|
+
This predicate treats Internal error messages with RST_STREAM errors as
|
|
152
|
+
ServiceUnavailable errors and will retry them if the Unavailable exception is retryable.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
exception_types: Exception types to be retried during operation
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
Callable[[Exception], bool]: A retry predicate that takes in an exception and
|
|
159
|
+
returns whether or not that exception is retryable
|
|
160
|
+
"""
|
|
161
|
+
# predicate to check for retryable error types
|
|
162
|
+
if_exception_type = retries.if_exception_type(*exception_types)
|
|
163
|
+
|
|
164
|
+
# special case: treat InternalServerError with rst_stream error message as ServiceUnavailable
|
|
165
|
+
def rst_check(e):
|
|
166
|
+
return (
|
|
167
|
+
core_exceptions.ServiceUnavailable in exception_types
|
|
168
|
+
and isinstance(e, core_exceptions.InternalServerError)
|
|
169
|
+
and isinstance(e.message, str)
|
|
170
|
+
and any(m in e.message.lower() for m in _RETRYABLE_INTERNAL_ERROR_MESSAGES)
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
return lambda e: if_exception_type(e) or rst_check(e)
|
|
174
|
+
|
|
175
|
+
|
|
129
176
|
def _get_timeouts(
|
|
130
177
|
operation: float | TABLE_DEFAULT,
|
|
131
178
|
attempt: float | None | TABLE_DEFAULT,
|
|
@@ -21,11 +21,13 @@ from __future__ import annotations
|
|
|
21
21
|
import time
|
|
22
22
|
from typing import TYPE_CHECKING, Sequence
|
|
23
23
|
|
|
24
|
-
from google.api_core import retry as retries
|
|
25
24
|
from grpc import StatusCode
|
|
26
25
|
|
|
27
26
|
from google.cloud.bigtable.data._cross_sync import CrossSync
|
|
28
|
-
from google.cloud.bigtable.data._helpers import
|
|
27
|
+
from google.cloud.bigtable.data._helpers import (
|
|
28
|
+
_attempt_timeout_generator,
|
|
29
|
+
_rst_stream_aware_predicate,
|
|
30
|
+
)
|
|
29
31
|
from google.cloud.bigtable.data._metrics.tracked_retry import tracked_retry
|
|
30
32
|
from google.cloud.bigtable.data.exceptions import (
|
|
31
33
|
InvalidChunk,
|
|
@@ -98,7 +100,7 @@ class _ReadRowsOperation:
|
|
|
98
100
|
else:
|
|
99
101
|
self.request = query._to_pb(target)
|
|
100
102
|
self.target = target
|
|
101
|
-
self._predicate =
|
|
103
|
+
self._predicate = _rst_stream_aware_predicate(*retryable_exceptions)
|
|
102
104
|
self._last_yielded_row_key: bytes | None = None
|
|
103
105
|
self._remaining_count: int | None = self.request.rows_limit or None
|
|
104
106
|
self._operation_metric = metric
|
|
@@ -141,6 +141,8 @@ class _BigtableExceptionGroup(ExceptionGroup if is_311_plus else Exception): #
|
|
|
141
141
|
return f"{self.__class__.__name__}({message!r}, {self.exceptions!r})"
|
|
142
142
|
|
|
143
143
|
|
|
144
|
+
# TODO: When working on mutations batcher, rework exception handling to guarantee that
|
|
145
|
+
# MutationsExceptionGroup only stores FailedMutationEntryErrors.
|
|
144
146
|
class MutationsExceptionGroup(_BigtableExceptionGroup):
|
|
145
147
|
"""
|
|
146
148
|
Represents one or more exceptions that occur during a bulk mutation operation
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Copyright 2024 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from itertools import islice
|
|
16
|
+
from typing import Generator, Iterable, Tuple, TypeVar
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# batched landed in standard library in Python 3.11.
|
|
22
|
+
def batched(iterable: Iterable[T], n) -> Generator[Tuple[T, ...], None, None]:
|
|
23
|
+
# batched('ABCDEFG', 3) → ABC DEF G
|
|
24
|
+
if n < 1:
|
|
25
|
+
raise ValueError("n must be at least one")
|
|
26
|
+
it = iter(iterable)
|
|
27
|
+
batch = tuple(islice(it, n))
|
|
28
|
+
while batch:
|
|
29
|
+
yield batch
|
|
30
|
+
batch = tuple(islice(it, n))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class _MappableAttributesMixin:
|
|
34
|
+
"""
|
|
35
|
+
Mixin for classes that need some of their attribute names remapped.
|
|
36
|
+
|
|
37
|
+
This is for taking some of the classes from the data client row filters
|
|
38
|
+
and row range classes that are 1:1 with their legacy client counterparts but with
|
|
39
|
+
some of their attributes renamed. To use in a class, override the base class with this mixin
|
|
40
|
+
class and define a map _attribute_map from legacy client attributes to data client
|
|
41
|
+
attributes.
|
|
42
|
+
|
|
43
|
+
Attributes are remapped and redefined in __init__ as well as getattr/setattr.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(self, *args, **kwargs):
|
|
47
|
+
new_kwargs = {self._attribute_map.get(k, k): v for (k, v) in kwargs.items()}
|
|
48
|
+
super(_MappableAttributesMixin, self).__init__(*args, **new_kwargs)
|
|
49
|
+
|
|
50
|
+
def __getattr__(self, name):
|
|
51
|
+
if name == "_attribute_map":
|
|
52
|
+
raise AttributeError
|
|
53
|
+
if name not in self._attribute_map:
|
|
54
|
+
raise AttributeError
|
|
55
|
+
return getattr(self, self._attribute_map[name])
|
|
56
|
+
|
|
57
|
+
def __setattr__(self, name, value):
|
|
58
|
+
if name == "_attribute_map":
|
|
59
|
+
super(_MappableAttributesMixin, self).__setattr__(name, value)
|
|
60
|
+
return
|
|
61
|
+
attribute = self._attribute_map.get(name, name)
|
|
62
|
+
super(_MappableAttributesMixin, self).__setattr__(attribute, value)
|
|
@@ -1009,6 +1009,16 @@ class PartialRowData(object):
|
|
|
1009
1009
|
self._row_key = row_key
|
|
1010
1010
|
self._cells = {}
|
|
1011
1011
|
|
|
1012
|
+
@classmethod
|
|
1013
|
+
def _from_data_client_row(cls, row):
|
|
1014
|
+
partial_row_data = cls(row.row_key)
|
|
1015
|
+
for column_family in row._index:
|
|
1016
|
+
columns = {}
|
|
1017
|
+
for column, items in row._index[column_family].items():
|
|
1018
|
+
columns[column] = [Cell._from_data_client_cell(item) for item in items]
|
|
1019
|
+
partial_row_data._cells[column_family] = columns
|
|
1020
|
+
return partial_row_data
|
|
1021
|
+
|
|
1012
1022
|
def __eq__(self, other):
|
|
1013
1023
|
if not isinstance(other, self.__class__):
|
|
1014
1024
|
return NotImplemented
|
|
@@ -1212,6 +1222,14 @@ class Cell(object):
|
|
|
1212
1222
|
else:
|
|
1213
1223
|
return cls(cell_pb.value, cell_pb.timestamp_micros)
|
|
1214
1224
|
|
|
1225
|
+
@classmethod
|
|
1226
|
+
def _from_data_client_cell(cls, cell):
|
|
1227
|
+
return cls(
|
|
1228
|
+
cell.value,
|
|
1229
|
+
cell.timestamp_micros,
|
|
1230
|
+
cell.labels,
|
|
1231
|
+
)
|
|
1232
|
+
|
|
1215
1233
|
@property
|
|
1216
1234
|
def timestamp(self):
|
|
1217
1235
|
return _datetime_from_microseconds(self.timestamp_micros)
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Container for Google Cloud Bigtable Cells and Streaming Row Contents."""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from typing import TYPE_CHECKING, Any, Generator
|
|
20
|
+
|
|
21
|
+
from google.api_core import exceptions, retry
|
|
22
|
+
|
|
23
|
+
from google.cloud.bigtable.row import Cell, InvalidChunk, PartialRowData
|
|
24
|
+
|
|
25
|
+
if TYPE_CHECKING:
|
|
26
|
+
from google.cloud.bigtable.data.row import Row
|
|
27
|
+
|
|
28
|
+
# Some classes need to be re-exported here to keep backwards
|
|
29
|
+
# compatibility. Those classes were moved to row_merger, but we dont want to
|
|
30
|
+
# break enduser's imports. This hack, ensures they don't get marked as unused.
|
|
31
|
+
_ = (Cell, InvalidChunk, PartialRowData)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class PartialCellData(object): # pragma: NO COVER
|
|
35
|
+
"""This class is no longer used and will be removed in the future"""
|
|
36
|
+
|
|
37
|
+
def __init__(
|
|
38
|
+
self, row_key, family_name, qualifier, timestamp_micros, labels=(), value=b""
|
|
39
|
+
):
|
|
40
|
+
self.row_key = row_key
|
|
41
|
+
self.family_name = family_name
|
|
42
|
+
self.qualifier = qualifier
|
|
43
|
+
self.timestamp_micros = timestamp_micros
|
|
44
|
+
self.labels = labels
|
|
45
|
+
self.value = value
|
|
46
|
+
|
|
47
|
+
def append_value(self, value):
|
|
48
|
+
self.value += value
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class InvalidReadRowsResponse(RuntimeError):
|
|
52
|
+
"""Exception raised to invalid response data from back-end."""
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class InvalidRetryRequest(RuntimeError):
|
|
56
|
+
"""Exception raised when retry request is invalid."""
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
DEFAULT_RETRY_READ_ROWS = retry.Retry(
|
|
60
|
+
initial=1.0,
|
|
61
|
+
maximum=15.0,
|
|
62
|
+
multiplier=2.0,
|
|
63
|
+
deadline=60.0, # 60 seconds
|
|
64
|
+
)
|
|
65
|
+
"""The default retry strategy to be used on retry-able errors.
|
|
66
|
+
|
|
67
|
+
Used by
|
|
68
|
+
:meth:`~google.cloud.bigtable.row_data.PartialRowsData._read_next_response`.
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class PartialRowsData(object):
|
|
73
|
+
"""Convenience wrapper for consuming a ``ReadRows`` streaming response.
|
|
74
|
+
|
|
75
|
+
This class will be returned by the ``read_rows`` method, and should not
|
|
76
|
+
be constructed manually.
|
|
77
|
+
|
|
78
|
+
:type read_method: :class:`client._table_data_client.read_rows`
|
|
79
|
+
:param read_method: ``ReadRows`` method.
|
|
80
|
+
|
|
81
|
+
:type generator: :class:`Iterable[Row]`
|
|
82
|
+
:param generator: The `Row` iterator from :meth:`Table.read_rows`.
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
def __init__(
|
|
86
|
+
self,
|
|
87
|
+
*args: Any,
|
|
88
|
+
generator: Generator[Row, Any, Any] | None = None,
|
|
89
|
+
**kwargs: Any,
|
|
90
|
+
) -> None:
|
|
91
|
+
self._generator: Generator[Row, Any, Any]
|
|
92
|
+
if generator is not None and not args and not kwargs:
|
|
93
|
+
self._generator = generator
|
|
94
|
+
else:
|
|
95
|
+
import warnings
|
|
96
|
+
|
|
97
|
+
warnings.warn(
|
|
98
|
+
"Direct instantiation of `PartialRowsData` is deprecated "
|
|
99
|
+
"and will be removed in a future release. `PartialRowsData` should only be obtained "
|
|
100
|
+
"by calling `Table.read_rows()`. An empty stream has been initialized.",
|
|
101
|
+
DeprecationWarning,
|
|
102
|
+
stacklevel=2,
|
|
103
|
+
)
|
|
104
|
+
self._generator = (x for x in ())
|
|
105
|
+
|
|
106
|
+
self.rows: dict[bytes, PartialRowData] = {}
|
|
107
|
+
|
|
108
|
+
@classmethod
|
|
109
|
+
def _from_generator(cls, generator: Generator[Row, Any, Any]) -> PartialRowsData:
|
|
110
|
+
"""Internal constructor for Table.read_rows."""
|
|
111
|
+
return cls(generator=generator)
|
|
112
|
+
|
|
113
|
+
@property
|
|
114
|
+
def state(self):
|
|
115
|
+
import warnings
|
|
116
|
+
|
|
117
|
+
warnings.warn(
|
|
118
|
+
"The `state` attribute on `PartialRowsData` is deprecated "
|
|
119
|
+
"and will return None.",
|
|
120
|
+
DeprecationWarning,
|
|
121
|
+
stacklevel=2,
|
|
122
|
+
)
|
|
123
|
+
return None
|
|
124
|
+
|
|
125
|
+
@property
|
|
126
|
+
def last_scanned_row_key(self):
|
|
127
|
+
import warnings
|
|
128
|
+
|
|
129
|
+
warnings.warn(
|
|
130
|
+
"The `last_scanned_row_key` attribute on `PartialRowsData` is deprecated "
|
|
131
|
+
"and will return None.",
|
|
132
|
+
DeprecationWarning,
|
|
133
|
+
stacklevel=2,
|
|
134
|
+
)
|
|
135
|
+
return None
|
|
136
|
+
|
|
137
|
+
@property
|
|
138
|
+
def read_method(self):
|
|
139
|
+
import warnings
|
|
140
|
+
|
|
141
|
+
warnings.warn(
|
|
142
|
+
"The `read_method` attribute on `PartialRowsData` is deprecated "
|
|
143
|
+
"and will return None.",
|
|
144
|
+
DeprecationWarning,
|
|
145
|
+
stacklevel=2,
|
|
146
|
+
)
|
|
147
|
+
return None
|
|
148
|
+
|
|
149
|
+
@property
|
|
150
|
+
def request(self):
|
|
151
|
+
import warnings
|
|
152
|
+
|
|
153
|
+
warnings.warn(
|
|
154
|
+
"The `request` attribute on `PartialRowsData` is deprecated "
|
|
155
|
+
"and will return None.",
|
|
156
|
+
DeprecationWarning,
|
|
157
|
+
stacklevel=2,
|
|
158
|
+
)
|
|
159
|
+
return None
|
|
160
|
+
|
|
161
|
+
@property
|
|
162
|
+
def retry(self):
|
|
163
|
+
import warnings
|
|
164
|
+
|
|
165
|
+
warnings.warn(
|
|
166
|
+
"The `retry` attribute on `PartialRowsData` is deprecated "
|
|
167
|
+
"and will return None.",
|
|
168
|
+
DeprecationWarning,
|
|
169
|
+
stacklevel=2,
|
|
170
|
+
)
|
|
171
|
+
return None
|
|
172
|
+
|
|
173
|
+
@property
|
|
174
|
+
def response_iterator(self):
|
|
175
|
+
import warnings
|
|
176
|
+
|
|
177
|
+
warnings.warn(
|
|
178
|
+
"The `response_iterator` attribute on `PartialRowsData` is deprecated "
|
|
179
|
+
"and will return None.",
|
|
180
|
+
DeprecationWarning,
|
|
181
|
+
stacklevel=2,
|
|
182
|
+
)
|
|
183
|
+
return None
|
|
184
|
+
|
|
185
|
+
def cancel(self):
|
|
186
|
+
"""Cancels the iterator, closing the stream."""
|
|
187
|
+
self._generator.close()
|
|
188
|
+
|
|
189
|
+
def consume_all(self, max_loops=None):
|
|
190
|
+
"""Consume the streamed responses until there are no more.
|
|
191
|
+
|
|
192
|
+
.. warning::
|
|
193
|
+
This method will be removed in future releases. Please use this
|
|
194
|
+
class as a generator instead.
|
|
195
|
+
|
|
196
|
+
:type max_loops: int
|
|
197
|
+
:param max_loops: (Deprecated). Maximum number of times to try to consume
|
|
198
|
+
an additional ``ReadRowsResponse``. This parameter is
|
|
199
|
+
deprecated and is only kept for backwards compatibility.
|
|
200
|
+
"""
|
|
201
|
+
for row in self:
|
|
202
|
+
self.rows[row.row_key] = row
|
|
203
|
+
|
|
204
|
+
def __iter__(self):
|
|
205
|
+
"""Consume the ``Row`` s from the stream.
|
|
206
|
+
Convert them to ``PartialRowData`` and yield each to the reader.
|
|
207
|
+
"""
|
|
208
|
+
try:
|
|
209
|
+
for row in self._generator:
|
|
210
|
+
yield PartialRowData._from_data_client_row(row)
|
|
211
|
+
|
|
212
|
+
# Any exception from the generator should cancel the iterator. A
|
|
213
|
+
# timeout, defined by catching a DeadlineExceeded, should be reraised
|
|
214
|
+
# as a RetryError instead.
|
|
215
|
+
except exceptions.DeadlineExceeded as e:
|
|
216
|
+
self.cancel()
|
|
217
|
+
raise exceptions.RetryError(e.message, e.__cause__)
|
|
218
|
+
except Exception as e:
|
|
219
|
+
self.cancel()
|
|
220
|
+
raise e
|
{google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/row_filters.py
RENAMED
|
@@ -50,6 +50,7 @@ from google.cloud.bigtable.data.row_filters import (
|
|
|
50
50
|
from google.cloud.bigtable.data.row_filters import (
|
|
51
51
|
TimestampRangeFilter as BaseTimestampRangeFilter,
|
|
52
52
|
)
|
|
53
|
+
from google.cloud.bigtable.helpers import _MappableAttributesMixin
|
|
53
54
|
|
|
54
55
|
_PACK_I64 = struct.Struct(">q").pack
|
|
55
56
|
|
|
@@ -70,35 +71,6 @@ def _deprecated_to_pb(self):
|
|
|
70
71
|
# Provide to_pb alias with DeprecationWarning for backwards compatibility with legacy client code
|
|
71
72
|
RowFilter.to_pb = _deprecated_to_pb # type: ignore[attr-defined]
|
|
72
73
|
TimestampRange.to_pb = _deprecated_to_pb # type: ignore[attr-defined]
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
class _MappableAttributesMixin:
|
|
76
|
-
"""
|
|
77
|
-
Mixin for classes that need some of their attribute names remapped.
|
|
78
|
-
|
|
79
|
-
This is for taking some of the classes from the data client row filters
|
|
80
|
-
that are 1:1 with their legacy client counterparts but with some of their
|
|
81
|
-
attributes renamed. To use in a class, override the base class with this mixin
|
|
82
|
-
class and define a map _attribute_map from legacy client attributes to data client
|
|
83
|
-
attributes.
|
|
84
|
-
|
|
85
|
-
Attributes are remapped and redefined in __init__ as well as getattr/setattr.
|
|
86
|
-
"""
|
|
87
|
-
|
|
88
|
-
def __init__(self, *args, **kwargs):
|
|
89
|
-
new_kwargs = {self._attribute_map.get(k, k): v for (k, v) in kwargs.items()}
|
|
90
|
-
super(_MappableAttributesMixin, self).__init__(*args, **new_kwargs)
|
|
91
|
-
|
|
92
|
-
def __getattr__(self, name):
|
|
93
|
-
if name not in self._attribute_map:
|
|
94
|
-
raise AttributeError
|
|
95
|
-
return getattr(self, self._attribute_map[name])
|
|
96
|
-
|
|
97
|
-
def __setattr__(self, name, value):
|
|
98
|
-
attribute = self._attribute_map.get(name, name)
|
|
99
|
-
super(_MappableAttributesMixin, self).__setattr__(attribute, value)
|
|
100
|
-
|
|
101
|
-
|
|
102
74
|
# The classes defined below are to provide constructors and members
|
|
103
75
|
# that have an interface that does not match the one used by the data
|
|
104
76
|
# client, for backwards compatibility purposes.
|
{google_cloud_bigtable-2.45.0 → google_cloud_bigtable-2.46.0}/google/cloud/bigtable/row_set.py
RENAMED
|
@@ -14,7 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
"""User-friendly container for Google Cloud Bigtable RowSet"""
|
|
16
16
|
|
|
17
|
-
from google.cloud.
|
|
17
|
+
from google.cloud.bigtable.data.read_rows_query import (
|
|
18
|
+
ReadRowsQuery,
|
|
19
|
+
)
|
|
20
|
+
from google.cloud.bigtable.data.read_rows_query import (
|
|
21
|
+
RowRange as BaseRowRange,
|
|
22
|
+
)
|
|
23
|
+
from google.cloud.bigtable.helpers import _MappableAttributesMixin
|
|
18
24
|
|
|
19
25
|
|
|
20
26
|
class RowSet(object):
|
|
@@ -25,30 +31,25 @@ class RowSet(object):
|
|
|
25
31
|
"""
|
|
26
32
|
|
|
27
33
|
def __init__(self):
|
|
28
|
-
self.
|
|
29
|
-
self.row_ranges = []
|
|
34
|
+
self._read_rows_query = ReadRowsQuery()
|
|
30
35
|
|
|
31
36
|
def __eq__(self, other):
|
|
32
37
|
if not isinstance(other, self.__class__):
|
|
33
38
|
return NotImplemented
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
return False
|
|
37
|
-
|
|
38
|
-
if len(other.row_ranges) != len(self.row_ranges):
|
|
39
|
-
return False
|
|
40
|
-
|
|
41
|
-
if not set(other.row_keys) == set(self.row_keys):
|
|
42
|
-
return False
|
|
43
|
-
|
|
44
|
-
if not set(other.row_ranges) == set(self.row_ranges):
|
|
45
|
-
return False
|
|
46
|
-
|
|
47
|
-
return True
|
|
40
|
+
return self._read_rows_query == other._read_rows_query
|
|
48
41
|
|
|
49
42
|
def __ne__(self, other):
|
|
50
43
|
return not self == other
|
|
51
44
|
|
|
45
|
+
@property
|
|
46
|
+
def row_keys(self):
|
|
47
|
+
return self._read_rows_query.row_keys
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def row_ranges(self):
|
|
51
|
+
return self._read_rows_query.row_ranges
|
|
52
|
+
|
|
52
53
|
def add_row_key(self, row_key):
|
|
53
54
|
"""Add row key to row_keys list.
|
|
54
55
|
|
|
@@ -62,7 +63,7 @@ class RowSet(object):
|
|
|
62
63
|
:type row_key: bytes
|
|
63
64
|
:param row_key: The key of a row to read
|
|
64
65
|
"""
|
|
65
|
-
self.
|
|
66
|
+
self._read_rows_query.add_key(row_key)
|
|
66
67
|
|
|
67
68
|
def add_row_range(self, row_range):
|
|
68
69
|
"""Add row_range to row_ranges list.
|
|
@@ -77,7 +78,7 @@ class RowSet(object):
|
|
|
77
78
|
:type row_range: class:`RowRange`
|
|
78
79
|
:param row_range: The row range object having start and end key
|
|
79
80
|
"""
|
|
80
|
-
self.
|
|
81
|
+
self._read_rows_query.add_range(row_range)
|
|
81
82
|
|
|
82
83
|
def add_row_range_from_keys(
|
|
83
84
|
self, start_key=None, end_key=None, start_inclusive=True, end_inclusive=False
|
|
@@ -109,7 +110,7 @@ class RowSet(object):
|
|
|
109
110
|
considered inclusive. The default is False (exclusive).
|
|
110
111
|
"""
|
|
111
112
|
row_range = RowRange(start_key, end_key, start_inclusive, end_inclusive)
|
|
112
|
-
self.
|
|
113
|
+
self._read_rows_query.add_range(row_range)
|
|
113
114
|
|
|
114
115
|
def add_row_range_with_prefix(self, row_key_prefix):
|
|
115
116
|
"""Add row range to row_ranges list that start with the row_key_prefix from the row keys
|
|
@@ -129,28 +130,15 @@ class RowSet(object):
|
|
|
129
130
|
row_key_prefix.encode("utf-8"), end_key.encode("utf-8")
|
|
130
131
|
)
|
|
131
132
|
|
|
132
|
-
def _update_message_request(self, message):
|
|
133
|
-
"""Add row keys and row range to given request message
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
:param message: The ``ReadRowsRequest`` protobuf
|
|
137
|
-
"""
|
|
138
|
-
for each in self.row_keys:
|
|
139
|
-
message.rows.row_keys._pb.append(_to_bytes(each))
|
|
140
|
-
|
|
141
|
-
for each in self.row_ranges:
|
|
142
|
-
r_kwrags = each.get_range_kwargs()
|
|
143
|
-
message.rows.row_ranges.append(r_kwrags)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
class RowRange(object):
|
|
134
|
+
class RowRange(_MappableAttributesMixin, BaseRowRange):
|
|
147
135
|
"""Convenience wrapper of google.bigtable.v2.RowRange
|
|
148
136
|
|
|
149
|
-
:type start_key: bytes
|
|
137
|
+
:type start_key: str | bytes
|
|
150
138
|
:param start_key: (Optional) Start key of the row range. If left empty,
|
|
151
139
|
will be interpreted as the empty string.
|
|
152
140
|
|
|
153
|
-
:type end_key: bytes
|
|
141
|
+
:type end_key: str | bytes
|
|
154
142
|
:param end_key: (Optional) End key of the row range. If left empty,
|
|
155
143
|
will be interpreted as the empty string and range will
|
|
156
144
|
be unbounded on the high end.
|
|
@@ -164,49 +152,31 @@ class RowRange(object):
|
|
|
164
152
|
considered inclusive. The default is False (exclusive).
|
|
165
153
|
"""
|
|
166
154
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
self.start_inclusive = start_inclusive
|
|
172
|
-
self.end_key = end_key
|
|
173
|
-
self.end_inclusive = end_inclusive
|
|
155
|
+
_attribute_map = {
|
|
156
|
+
"start_inclusive": "start_is_inclusive",
|
|
157
|
+
"end_inclusive": "end_is_inclusive",
|
|
158
|
+
}
|
|
174
159
|
|
|
175
160
|
def _key(self):
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
"""
|
|
183
|
-
return (self.start_key, self.start_inclusive, self.end_key, self.end_inclusive)
|
|
161
|
+
return (
|
|
162
|
+
self.start_key,
|
|
163
|
+
self.end_key,
|
|
164
|
+
self.start_is_inclusive,
|
|
165
|
+
self.end_is_inclusive,
|
|
166
|
+
)
|
|
184
167
|
|
|
185
168
|
def __hash__(self):
|
|
186
169
|
return hash(self._key())
|
|
187
170
|
|
|
188
|
-
def __eq__(self, other):
|
|
189
|
-
if not isinstance(other, self.__class__):
|
|
190
|
-
return NotImplemented
|
|
191
|
-
return self._key() == other._key()
|
|
192
|
-
|
|
193
|
-
def __ne__(self, other):
|
|
194
|
-
return not self == other
|
|
195
|
-
|
|
196
171
|
def get_range_kwargs(self):
|
|
197
172
|
"""Convert row range object to dict which can be passed to
|
|
198
173
|
google.bigtable.v2.RowRange add method.
|
|
199
174
|
"""
|
|
200
175
|
range_kwargs = {}
|
|
201
176
|
if self.start_key is not None:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
start_key_key = "start_key_closed"
|
|
205
|
-
range_kwargs[start_key_key] = _to_bytes(self.start_key)
|
|
206
|
-
|
|
177
|
+
key = "start_key_closed" if self.start_is_inclusive else "start_key_open"
|
|
178
|
+
range_kwargs[key] = self.start_key
|
|
207
179
|
if self.end_key is not None:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
end_key_key = "end_key_closed"
|
|
211
|
-
range_kwargs[end_key_key] = _to_bytes(self.end_key)
|
|
180
|
+
key = "end_key_closed" if self.end_is_inclusive else "end_key_open"
|
|
181
|
+
range_kwargs[key] = self.end_key
|
|
212
182
|
return range_kwargs
|