Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
1 change: 0 additions & 1 deletion google/cloud/bigquery_v2/services/job_service/pagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def __init__(
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),

):
"""Instantiate the pager.

Expand Down
31 changes: 31 additions & 0 deletions scripts/microgenerator/bigqueryclient.py.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# TODO: Add a header if needed.

# ======== 🦕 HERE THERE BE DINOSAURS 🦖 =========
# This content is subject to significant change. Not for review yet.
# Included as a proof of concept for context or testing ONLY.
# ================================================

class BigQueryClient:
def __init__(self):
self._clients = {}

{% for method in methods %}
def {{ method.name }}({{ method.args_for_def }}):
"""TODO: extract docstring for use here.
A generated method to call the BigQuery API."""

if "{{ method.class_name }}" not in self._clients:
from google.cloud.bigquery_v2 import {{ method.class_name }}
self._clients["{{ method.class_name }}"] = {{ method.class_name }}()

client = self._clients["{{ method.class_name }}"]
from google.cloud.bigquery_v2 import types
request = types.{{ method.request_class_name }}({{ method.args_for_call }})
return client.{{ method.name }}(request=request)

{% endfor %}

# ======== 🦕 HERE THERE WERE DINOSAURS 🦖 =========
# The above content is subject to significant change. Not for review yet.
# Included as a proof of concept for context or testing ONLY.
# ================================================
45 changes: 45 additions & 0 deletions scripts/microgenerator/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# config.yaml

# The name of the service, used for variable names and comments.
service_name: "bigquery"

# A list of paths to the source code files to be parsed.
# Globs are supported.
source_files:
- "autogen/google/cloud/bigquery_v2/services/dataset_service/client.py"
- "autogen/google/cloud/bigquery_v2/services/job_service/client.py"
- "autogen/google/cloud/bigquery_v2/services/model_service/client.py"
- "autogen/google/cloud/bigquery_v2/services/project_service/client.py"
- "autogen/google/cloud/bigquery_v2/services/routine_service/client.py"
- "autogen/google/cloud/bigquery_v2/services/row_access_policy_service/client.py"
- "autogen/google/cloud/bigquery_v2/services/table_service/client.py"

# Filtering rules for classes and methods.
filter:
classes:
# Only include classes with these suffixes.
include_suffixes:
- "Client"
methods:
# Include methods with these prefixes.
include_prefixes:
- "batch_delete_"
- "cancel_"
- "create_"
- "delete_"
- "get_"
- "insert_"
- "list_"
- "patch_"
- "undelete_"
- "update_"
# Exclude methods with these prefixes.
exclude_prefixes:
- "get_mtls_endpoint_and_cert_source"

# A list of templates to render and their corresponding output files.
templates:
- template: "autogen/scripts/microgenerator/bigqueryclient.py.j2"
output: "autogen/google/cloud/bigquery_v2/services/centralized_service/client.py"
# - template: "test_bigqueryclient.py.j2"
# output: "tests/unit/test_bigqueryclient.py"
Loading
Loading