Skip to content

Commit

Permalink
fix: export handwritten classes AppendRowsStream and ReadRowsStream (#…
Browse files Browse the repository at this point in the history
…770)

* fix: export handwritten classes

* change init file accordingly

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* correct import path

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix import

* fix error

* delete a commented out line

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
Linchin and gcf-owl-bot[bot] committed Apr 15, 2024
1 parent 4942bd1 commit 198c312
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions google/cloud/bigquery_storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from google.cloud.bigquery_storage_v1 import BigQueryReadClient
from google.cloud.bigquery_storage_v1 import gapic_types as types
from google.cloud.bigquery_storage_v1.reader import ReadRowsStream
from google.cloud.bigquery_storage_v1.services.big_query_write.async_client import (
BigQueryWriteAsyncClient,
)
Expand Down Expand Up @@ -66,6 +67,7 @@
WriteStreamView,
)
from google.cloud.bigquery_storage_v1.types.table import TableFieldSchema, TableSchema
from google.cloud.bigquery_storage_v1.writer import AppendRowsStream

__all__ = (
"BigQueryReadClient",
Expand Down Expand Up @@ -101,6 +103,8 @@
"StreamStats",
"ThrottleState",
"ReadSession",
"AppendRowsStream",
"ReadRowsStream",
"ReadStream",
"WriteStream",
"DataFormat",
Expand Down
20 changes: 20 additions & 0 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@
'"DataFormat",\n \\g<0>',
)

# Expose handwritten classes AppendRowsStream and ReadRowsStream here.
s.replace(
library / "google/cloud/bigquery_storage/__init__.py",
f"from google.cloud.bigquery_storage_{library.name} import BigQueryReadClient",
(
f"from google.cloud.bigquery_storage_{library.name}.writer import AppendRowsStream\n"
"\\g<0>"
f"from google.cloud.bigquery_storage_{library.name}.reader import ReadRowsStream\n"
),
)
s.replace(
library / f"google/cloud/bigquery_storage_{library.name}*/types/__init__.py",
r"""["']ReadSession["']""",
(
'"AppendRowsStream",\n'
' "ReadRowsStream",\n'
' \\g<0>'
),
)

s.move(
[library],
excludes=[
Expand Down

0 comments on commit 198c312

Please sign in to comment.