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

Dataproc: Update docs/conf.py, add routing header to method metadata, fix docstrings (via synth). #7924

Merged
merged 1 commit into from
May 14, 2019
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
23 changes: 14 additions & 9 deletions dataproc/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = [".rst", ".md"]

# The encoding of source files.
Expand Down Expand Up @@ -130,10 +131,10 @@
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
#'description': 'Google Cloud Client Libraries for Python',
#'github_user': 'GoogleCloudPlatform',
#'github_repo': 'google-cloud-python',
#'github_banner': True,
"description": "Google Cloud Client Libraries for Python",
"github_user": "googleapis",
"github_repo": "google-cloud-python",
"github_banner": True,
"font_family": "'Roboto', Georgia, sans",
"head_font_family": "'Roboto', Georgia, serif",
"code_font_family": "'Roboto Mono', 'Consolas', monospace",
Expand Down Expand Up @@ -226,18 +227,17 @@
# Output file base name for HTML help builder.
htmlhelp_basename = "google-cloud-dataproc-doc"


# -- Options for warnings ------------------------------------------------------


suppress_warnings = [
# Temporarily suppress ths to avoid "more than one target found for
# Temporarily suppress this to avoid "more than one target found for
# cross-reference" warning, which are intractable for us to avoid while in
# a mono-repo.
# See https://github.com/sphinx-doc/sphinx/blob
# /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843
"ref.python"
]

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
Expand Down Expand Up @@ -330,15 +330,20 @@
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False

# Configuration for intersphinx:
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("http://python.readthedocs.org/en/latest/", None),
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
"google.api_core": (
"https://googleapis.github.io/google-cloud-python/latest",
None,
),
"grpc": ("https://grpc.io/grpc/python/", None),
"requests": ("http://docs.python-requests.org/en/master/", None),
"fastavro": ("https://fastavro.readthedocs.io/en/stable/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"python": ("https://docs.python.org/3", None),
}

# Napoleon settings
Expand Down
145 changes: 20 additions & 125 deletions dataproc/google/cloud/dataproc_v1/gapic/cluster_controller_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,131 +366,26 @@ def update_cluster(

.. raw:: html

<table>

.. raw:: html

<tbody>

.. raw:: html

<tr>

.. raw:: html

<td>

Mask

.. raw:: html

</td>

.. raw:: html

<td>

Purpose

.. raw:: html

</td>

.. raw:: html

</tr>

.. raw:: html

<tr>

.. raw:: html

<td>

labels

.. raw:: html

</td>

.. raw:: html

<td>

Update labels

.. raw:: html

</td>

.. raw:: html

</tr>

.. raw:: html

<tr>

.. raw:: html

<td>

config.worker\_config.num\_instances

.. raw:: html

</td>

.. raw:: html

<td>

Resize primary worker group

.. raw:: html

</td>

.. raw:: html

</tr>

.. raw:: html

<tr>

.. raw:: html

<td>

config.secondary\_worker\_config.num\_instances

.. raw:: html

</td>

.. raw:: html

<td>

Resize secondary worker group

.. raw:: html

</td>

.. raw:: html

</tr>

.. raw:: html

</tbody>

.. raw:: html

</table>
<table>
<tbody>
<tr>
<td><strong>Mask</strong></td>
<td><strong>Purpose</strong></td>
</tr>
<tr>
<td><strong><em>labels</em></strong></td>
<td>Update labels</td>
</tr>
<tr>
<td><strong><em>config.worker_config.num_instances</em></strong></td>
<td>Resize primary worker group</td>
</tr>
<tr>
<td><strong><em>config.secondary_worker_config.num_instances</em></strong></td>
<td>Resize secondary worker group</td>
</tr>
</tbody>
</table>

If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.dataproc_v1.types.FieldMask`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.api_core.gapic_v1.routing_header
import google.api_core.grpc_helpers
import google.api_core.operation
import google.api_core.operations_v1
Expand Down Expand Up @@ -263,6 +264,19 @@ def create_workflow_template(
request = workflow_templates_pb2.CreateWorkflowTemplateRequest(
parent=parent, template=template
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [("parent", parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header
)
metadata.append(routing_metadata)

return self._inner_api_calls["create_workflow_template"](
request, retry=retry, timeout=timeout, metadata=metadata
)
Expand Down Expand Up @@ -331,6 +345,19 @@ def get_workflow_template(
request = workflow_templates_pb2.GetWorkflowTemplateRequest(
name=name, version=version
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [("name", name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header
)
metadata.append(routing_metadata)

return self._inner_api_calls["get_workflow_template"](
request, retry=retry, timeout=timeout, metadata=metadata
)
Expand Down Expand Up @@ -434,6 +461,19 @@ def instantiate_workflow_template(
request = workflow_templates_pb2.InstantiateWorkflowTemplateRequest(
name=name, version=version, request_id=request_id, parameters=parameters
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [("name", name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header
)
metadata.append(routing_metadata)

operation = self._inner_api_calls["instantiate_workflow_template"](
request, retry=retry, timeout=timeout, metadata=metadata
)
Expand Down Expand Up @@ -547,6 +587,19 @@ def instantiate_inline_workflow_template(
request = workflow_templates_pb2.InstantiateInlineWorkflowTemplateRequest(
parent=parent, template=template, request_id=request_id
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [("parent", parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header
)
metadata.append(routing_metadata)

operation = self._inner_api_calls["instantiate_inline_workflow_template"](
request, retry=retry, timeout=timeout, metadata=metadata
)
Expand Down Expand Up @@ -618,6 +671,19 @@ def update_workflow_template(
request = workflow_templates_pb2.UpdateWorkflowTemplateRequest(
template=template
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [("template.name", template.name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header
)
metadata.append(routing_metadata)

return self._inner_api_calls["update_workflow_template"](
request, retry=retry, timeout=timeout, metadata=metadata
)
Expand Down Expand Up @@ -699,6 +765,19 @@ def list_workflow_templates(
request = workflow_templates_pb2.ListWorkflowTemplatesRequest(
parent=parent, page_size=page_size
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [("parent", parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header
)
metadata.append(routing_metadata)

iterator = google.api_core.page_iterator.GRPCIterator(
client=None,
method=functools.partial(
Expand Down Expand Up @@ -771,6 +850,19 @@ def delete_workflow_template(
request = workflow_templates_pb2.DeleteWorkflowTemplateRequest(
name=name, version=version
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [("name", name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header
)
metadata.append(routing_metadata)

self._inner_api_calls["delete_workflow_template"](
request, retry=retry, timeout=timeout, metadata=metadata
)
Loading