Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
feat: add
BigQueryWriteClient
where append_rows
returns a helper …
…for writing rows (#284) * WIP: write client sample * add sample with nullable types * add schema for all supported types * add complex types to code sample * refactor sample so that it can be tested * make test assertions more thorough * fix lint error * remove done TODO * address reviewer comments * fix tag mismatch * test on multiple regions * correct comments about why offset exists * upgrade g-c-b * WIP: invert stream using BiDi class * WIP: attempt to use Future for send instead * WIP: use futures, populated by background consumer * make sure stream is actually open before returning from open * copy close implementation from pub/sub * support extra metadata * process exceptions, add open timeout * sort imports * WIP: unit tests * drain futures when stream closes * update docs * add callbacks to detect when a stream fails * add unit tests * add sleep to loop waiting for RPC to be active * don't freeze if initial RPC fails * add needed initializations so done() functions * fail fast when there is a problem with the initial request * don't inherit concurrent.futures It's unnecessary and kept resulting in stuff getting stuck. * add unit test for open timeout *🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add manual client to docs * typo in sample comments * force timeout and metadata to be kwargs * unify interface for sending row data * pull stream name from merged request * require newer proto-plus for copy_from method Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
Showing
with
1,943 additions
and 41 deletions.
- +4 −0 docs/bigquery_storage_v1beta2/library.rst
- +5 −0 google/cloud/bigquery_storage_v1beta2/__init__.py
- +9 −3 google/cloud/bigquery_storage_v1beta2/client.py
- +17 −0 google/cloud/bigquery_storage_v1beta2/exceptions.py
- +412 −0 google/cloud/bigquery_storage_v1beta2/writer.py
- +1 −1 noxfile.py
- +10 −11 owlbot.py
- +15 −0 samples/snippets/__init__.py
- +249 −0 samples/snippets/append_rows_proto2.py
- +126 −0 samples/snippets/append_rows_proto2_test.py
- +60 −0 samples/snippets/conftest.py
- +266 −0 samples/snippets/noxfile.py
- +2 −0 samples/snippets/requirements-test.txt
- +3 −0 samples/snippets/requirements.txt
- +61 −0 samples/snippets/sample_data.proto
- +418 −0 samples/snippets/sample_data_pb2.py
- +76 −0 samples/snippets/sample_data_schema.json
- +1 −0 samples/to_dataframe/requirements.txt
- +5 −4 setup.py
- +1 −1 testing/constraints-3.6.txt
- +0 −21 tests/system/conftest.py
- +22 −0 tests/system/reader/test_reader.py
- +33 −0 tests/system/test_writer.py
- +147 −0 tests/unit/test_writer_v1beta2.py
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,17 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
class StreamClosedError(Exception): | ||
"""Operation not supported while stream is closed.""" |
Oops, something went wrong.