Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

submit_job_to_cluster script broken #100

Closed
TheMichaelHu opened this issue Nov 12, 2020 · 5 comments
Closed

submit_job_to_cluster script broken #100

TheMichaelHu opened this issue Nov 12, 2020 · 5 comments
Assignees
Labels
api: dataproc Issues related to the googleapis/python-dataproc API. samples Issues that are directly related to samples. type: docs Improvement to the documentation for an API.

Comments

@TheMichaelHu
Copy link

TheMichaelHu commented Nov 12, 2020

When following along https://cloud.google.com/dataproc/docs/tutorials/python-library-example using the latest version of the python client (2.0.2), I get the following error:

>>> from google.cloud.dataproc_v1.gapic.transports import cluster_controller_grpc_transport
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'google.cloud.dataproc_v1.gapic'

The snippets come from https://github.com/googleapis/python-dataproc/blob/master/samples/snippets/submit_job_to_cluster.py

Looks like in #71 the gapic directory was removed. What I had to do instead was

from google.cloud.dataproc_v1.services.cluster_controller.transports.grpc import ClusterControllerGrpcTransport

client_transport = ClusterControllerGrpcTransport(
    host='{}-dataproc.googleapis.com'.format(region)
)
cluster_client = dataproc_v1.ClusterControllerClient(transport=client_transport)
@product-auto-label product-auto-label bot added the api: dataproc Issues related to the googleapis/python-dataproc API. label Nov 12, 2020
@bradmiro
Copy link
Contributor

Thanks @TheMichaelHu for pointing this out. These samples are a bit outdated and need to be updated. In the mean time, I would recommending following along here for an updated introduction to using the Python client library :)

@TheMichaelHu
Copy link
Author

Thanks, that example is much more straightforward! This is what I get for skipping the quickstart.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Nov 13, 2020
@meredithslota meredithslota added samples Issues that are directly related to samples. type: docs Improvement to the documentation for an API. and removed triage me I really want to be triaged. labels Nov 17, 2020
@pvanderlinden
Copy link

The examples, and the docs should be up to date though?

The docs are severely lacking usage, and needs digging in the source code, which I now had to do again while porting it to version 2. Also I find it strange that certain functions are removed, like the method to get the parent string. The function also lacks a function to construct the transport url. It would be good to hide these details in the library, in general this library feels really primitive compared to other python google api's.

@bradmiro
Copy link
Contributor

bradmiro commented Dec 8, 2020

Hey @pvanderlinden , thanks for your feedback. If you have a specific example for what you're trying to do, feel free to open a separate issue and we can follow up there :)

@bradmiro
Copy link
Contributor

bradmiro commented Dec 9, 2020

The docs have been updated so I'll be closing this.

@bradmiro bradmiro closed this as completed Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: dataproc Issues related to the googleapis/python-dataproc API. samples Issues that are directly related to samples. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

No branches or pull requests

5 participants