Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ def main(project_id, instance_id, table_id):
# [END bigtable_hw_create_table]

try:
# Wait for table creation to propagate to the data plane.
from google.api_core.exceptions import FailedPrecondition, NotFound

table.read_row(
b"greeting0",
operation_timeout=120,
retryable_errors=(
*table.default_read_rows_retryable_errors,
FailedPrecondition,
NotFound,
),
)
# [START bigtable_hw_write_rows]
print("Writing some greetings to the table.")
greetings = [b"Hello World!", b"Hello Cloud Bigtable!", b"Hello Python!"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ async def main(project_id, instance_id, table_id):
# [END bigtable_async_hw_create_table]

try:
# Wait for table creation to propagate to the data plane.
from google.api_core.exceptions import FailedPrecondition, NotFound

await table.read_row(
b"greeting0",
operation_timeout=120,
retryable_errors=(
*table.default_read_rows_retryable_errors,
FailedPrecondition,
NotFound,
),
)
# [START bigtable_async_hw_write_rows]
print("Writing some greetings to the table.")
greetings = [b"Hello World!", b"Hello Cloud Bigtable!", b"Hello Python!"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ async def test_ctor_defaults(self):
instance._retryable_errors
== table.default_mutate_rows_retryable_errors
)
await CrossSync.yield_to_event_loop()
await CrossSync.wait([instance._flush_timer])
assert flush_timer_mock.call_count == 1
assert flush_timer_mock.call_args[0][0] == 5
assert isinstance(instance._flush_timer, CrossSync.Future)
Expand Down Expand Up @@ -457,7 +457,7 @@ async def test_ctor_explicit(self):
assert instance._operation_timeout == operation_timeout
assert instance._attempt_timeout == attempt_timeout
assert instance._retryable_errors == retryable_errors
await CrossSync.yield_to_event_loop()
await CrossSync.wait([instance._flush_timer])
assert flush_timer_mock.call_count == 1
assert flush_timer_mock.call_args[0][0] == flush_interval
assert isinstance(instance._flush_timer, CrossSync.Future)
Expand Down Expand Up @@ -491,7 +491,7 @@ async def test_ctor_no_flush_limits(self):
assert instance._flow_control._in_flight_mutation_count == 0
assert instance._flow_control._in_flight_mutation_bytes == 0
assert instance._entries_processed_since_last_raise == 0
await CrossSync.yield_to_event_loop()
await CrossSync.wait([instance._flush_timer])
assert flush_timer_mock.call_count == 1
assert flush_timer_mock.call_args[0][0] is None
assert isinstance(instance._flush_timer, CrossSync.Future)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def test_ctor_defaults(self):
instance._retryable_errors
== table.default_mutate_rows_retryable_errors
)
CrossSync._Sync_Impl.yield_to_event_loop()
CrossSync._Sync_Impl.wait([instance._flush_timer])
assert flush_timer_mock.call_count == 1
assert flush_timer_mock.call_args[0][0] == 5
assert isinstance(instance._flush_timer, CrossSync._Sync_Impl.Future)
Expand Down Expand Up @@ -406,7 +406,7 @@ def test_ctor_explicit(self):
assert instance._operation_timeout == operation_timeout
assert instance._attempt_timeout == attempt_timeout
assert instance._retryable_errors == retryable_errors
CrossSync._Sync_Impl.yield_to_event_loop()
CrossSync._Sync_Impl.wait([instance._flush_timer])
assert flush_timer_mock.call_count == 1
assert flush_timer_mock.call_args[0][0] == flush_interval
assert isinstance(instance._flush_timer, CrossSync._Sync_Impl.Future)
Expand Down Expand Up @@ -441,7 +441,7 @@ def test_ctor_no_flush_limits(self):
assert instance._flow_control._in_flight_mutation_count == 0
assert instance._flow_control._in_flight_mutation_bytes == 0
assert instance._entries_processed_since_last_raise == 0
CrossSync._Sync_Impl.yield_to_event_loop()
CrossSync._Sync_Impl.wait([instance._flush_timer])
assert flush_timer_mock.call_count == 1
assert flush_timer_mock.call_args[0][0] is None
assert isinstance(instance._flush_timer, CrossSync._Sync_Impl.Future)
Expand Down
Loading