GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AutoML: add a get_operation_status method to clients · Issue #7 · googleapis/python-automl

This repository was archived by the owner on Dec 31, 2023. It is now read-only.
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

AutoML: add a get_operation_status method to clients #7

Copy link
Copy link
Closed
Closed
AutoML: add a get_operation_status method to clients#7
Copy link
Labels
api: automlIssues related to the googleapis/python-automl API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@crwilcox
crwilcox
opened on Jul 19, 2018
Issue body actions

in GoogleCloudPlatform/python-docs-samples#1575 (comment) I noticed one of our samples is relying on an internal method client.transport._operations_client.get_operation(.

@sirtorry said it is common for training jobs to take long periods of time and having a way of checking on the status is useful.

I believe we should consider exposing a method, perhaps one of the following.

response = client.create_model(project_location, my_model)
response.get_status()

or

operation_name = response.operation.name
client.get_operation_status(operation_name)

It also seems operation.refresh() will do the same thing. Perhaps there is a way to do this currently without adding this functionality?


class Operation(polling.PollingFuture):
    """A Future for interacting with a Google API Long-Running Operation.

    Args:
        operation (google.longrunning.operations_pb2.Operation): The
            initial operation.
        refresh (Callable[[], ~.api_core.operation.Operation]): A callable that
            returns the latest state of the operation.
        cancel (Callable[[], None]): A callable that tries to cancel
            the operation.
        result_type (func:`type`): The protobuf type for the operation's
            result.
        metadata_type (func:`type`): The protobuf type for the operation's
            metadata.
        retry (google.api_core.retry.Retry): The retry configuration used
            when polling. This can be used to control how often :meth:`done`
            is polled. Regardless of the retry's ``deadline``, it will be
            overridden by the ``timeout`` argument to :meth:`result`.
    """

Activity

  1. crwilcox commented on Jul 19, 2018

    @crwilcox
    crwilcox
    on Jul 19, 2018
    ContributorAuthor
    More actions

    cc @sirtorry

  2. crwilcox commented on Jul 20, 2018

    @crwilcox
    crwilcox
    on Jul 20, 2018
    ContributorAuthor
    More actions

    Currently you have to do the following. If we add a method for get_operation this simplifies greatly. It enables getting status and cancelling operations.

    import google.api_core.operation
    import google.api_core.operations_v1
    from google.longrunning import operations_pb2
    
    operations_client = operations_v1.OperationsClient(
        channel=automl_client.channel)
    
    operation = google.api_core.operation.Operation(
        operations_pb2.Operation(name=operation_id),
        operations_client,
        google.cloud.automl.types.Model)
    
    operation.cancel()
    
  3. busunkim96
    transferred this issue fromgoogleapis/google-cloud-pythonon Jan 31, 2020
  4. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Jan 31, 2020
  5. busunkim96
    added
    api: automlIssues related to the googleapis/python-automl API.
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    🚨This issue needs some love.
    triage meI really want to be triaged.
    on Jan 31, 2020
  6. sirtorry
    self-assigned this
    on Feb 4, 2020
  7. sirtorry
    removed their assignment
    on Feb 19, 2020
  8. mf2199
    assigned
    paul1319
    on Jun 18, 2020
  9. paul1319
    removed their assignment
    on Oct 17, 2020
  10. munkhuushmgl commented on Jun 22, 2021

    @munkhuushmgl
    munkhuushmgl
    on Jun 22, 2021
    Contributor
    More actions

    Feel free to reopen this,
    Doesn't the following operation fulfill this requesT?

    python-automl/samples/snippets/get_operation_status.py

    Line 27 in 182cf33

    response = client._transport.operations_client.get_operation(operation_full_id)

  11. munkhuushmgl
    closed this as completedon Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: automlIssues related to the googleapis/python-automl API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.