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 — NameError: name 'operation' is not defined · Issue #610 · googleapis/gapic-generator-python

This repository was archived by the owner on Aug 25, 2026. It is now read-only.
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

NameError: name 'operation' is not defined #610

Copy link
Copy link
Closed
Closed
NameError: name 'operation' is not defined#610
Copy link
Assignees
software-dov
Labels
priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@busunkim96
busunkim96
opened on Sep 22, 2020
Issue body actions

I'm seeing generated test fails on 0.33.4 for a new library google/cloud/aiplatform

The problem seems to be that google.api_core.operation is imported as ga_operation but the client references it as operation later on.

The API appears to have it's own operation type (from google.cloud.aiplatform_v1beta1.types import operation as gca_operation) which may be causing the conflict.

from collections import OrderedDict
from distutils import util
import os
import re
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib  # type: ignore
from google.api_core import exceptions                            # type: ignore
from google.api_core import gapic_v1                              # type: ignore
from google.api_core import retry as retries                      # type: ignore
from google.auth import credentials                               # type: ignore
from google.auth.transport import mtls                            # type: ignore
from google.auth.transport.grpc import SslCredentials             # type: ignore
from google.auth.exceptions import MutualTLSChannelError          # type: ignore
from google.oauth2 import service_account                         # type: ignore

from google.api_core import operation as ga_operation  # type: ignore
from google.api_core import operation_async  # type: ignore
from google.cloud.aiplatform_v1beta1.services.specialist_pool_service import pagers
from google.cloud.aiplatform_v1beta1.types import operation as gca_operation
from google.cloud.aiplatform_v1beta1.types import specialist_pool
from google.cloud.aiplatform_v1beta1.types import specialist_pool as gca_specialist_pool
from google.cloud.aiplatform_v1beta1.types import specialist_pool_service
from google.protobuf import empty_pb2 as empty  # type: ignore
from google.protobuf import field_mask_pb2 as field_mask  # type: ignore

from .transports.base import SpecialistPoolServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import SpecialistPoolServiceGrpcTransport
from .transports.grpc_asyncio import SpecialistPoolServiceGrpcAsyncIOTransport
        # Wrap the response in an operation future.
>       response = operation.from_gapic(
            response,
            self._transport.operations_client,
            gca_specialist_pool.SpecialistPool,
            metadata_type=specialist_pool_service.UpdateSpecialistPoolOperationMetadata,
        )
E       NameError: name 'operation' is not defined

google/cloud/aiplatform_v1beta1/services/specialist_pool_service/client.py:745: NameError

Activity

  1. busunkim96
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Sep 22, 2020
  2. danoscarmike
    added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    and removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Sep 22, 2020
  3. danoscarmike commented on Sep 22, 2020

    @danoscarmike
    danoscarmike
    on Sep 22, 2020
    Contributor
    More actions

    Bumping priority due to impact to product launch

  4. hkdevandla
    assigned
    software-dov
    on Sep 22, 2020
  5. hkdevandla commented on Sep 22, 2020

    @hkdevandla
    hkdevandla
    on Sep 22, 2020
    More actions

    Dov, can you please take a look? Thanks!

  6. software-dov commented on Sep 22, 2020

    @software-dov
    software-dov
    on Sep 22, 2020
    Contributor
    More actions

    On it.

  7. busunkim96 commented on Sep 22, 2020

    @busunkim96
    busunkim96
    on Sep 22, 2020
    ContributorAuthor
    More actions

    👋 I had a chat with @dizcology and AI Platform will likely have to use an older version of this generator for the time being b/c of other concerns. It it is alright to drop the priority on this since they already have a synth replace fix they wrote for the alpha.

  8. software-dov commented on Sep 22, 2020

    @software-dov
    software-dov
    on Sep 22, 2020
    Contributor
    More actions

    I've got a fix I'm just about to post review, but it looks like there are other unit tests that are failing too.

  9. software-dov
    added 2 commits that reference this issue on Sep 22, 2020

    fix: operation module is properly aliased if necessary

    299b066

    fix: operation module is properly aliased if necessary (#615)

    8f92fd9
  10. software-dov commented on Sep 22, 2020

    @software-dov
    software-dov
    on Sep 22, 2020
    Contributor
    More actions

    Fixed by #615

  11. software-dov
    closed this as completedon Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @software-dov
    software-dov

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

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.