Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add AppendRowsStream to use write API from v1 endpoint #309

Merged
merged 3 commits into from Sep 27, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions google/cloud/bigquery_storage_v1/__init__.py
Expand Up @@ -30,6 +30,10 @@ class BigQueryReadClient(client.BigQueryReadClient):
__doc__ = client.BigQueryReadClient.__doc__


class BigQueryWriteClient(client.BigQueryWriteClient):
__doc__ = client.BigQueryWriteClient.__doc__


__all__ = (
# google.cloud.bigquery_storage_v1
"__version__",
Expand Down
5 changes: 5 additions & 0 deletions google/cloud/bigquery_storage_v1/client.py
Expand Up @@ -25,6 +25,7 @@

from google.cloud.bigquery_storage_v1 import reader
from google.cloud.bigquery_storage_v1.services import big_query_read
from google.cloud.bigquery_storage_v1.services import big_query_write


_SCOPES = (
Expand Down Expand Up @@ -135,3 +136,7 @@ def read_rows(
offset,
{"retry": retry, "timeout": timeout, "metadata": metadata},
)


class BigQueryWriteClient(big_query_write.BigQueryWriteClient):
__doc__ = big_query_write.BigQueryWriteClient.__doc__
17 changes: 17 additions & 0 deletions google/cloud/bigquery_storage_v1/exceptions.py
@@ -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."""