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 — [Vision] No Exceptions raised for non-existent gcs uri's · Issue #3268 · googleapis/google-cloud-python

[Vision] No Exceptions raised for non-existent gcs uri's  #3268

New issue
Copy link
New issue
Copy link
Closed
Closed
[Vision] No Exceptions raised for non-existent gcs uri's #3268
Copy link
Labels
api: visionIssues related to the Cloud Vision API.

Description

@ghost
ghost
opened on Apr 3, 2017

Hi,

Google Vision python package doesn't raise exceptions for non-existent gcs uri resources, instead returns an annotation object with empty list for texts. This makes it harder to tell if the resource doesn't exist or if the vision api failed to detect any text.

  1. OS type and version: macOS Sierra 10.12.3
  2. Python version: Python 2.7.10
  3. google-cloud-python version: Version: 0.23.0
  4. Code example - relevant code snippets
from google.cloud import storage, vision
from google.cloud.storage import Blob
from google.cloud.vision.image import Feature
from google.cloud.vision.image import FeatureTypes

features = [Feature(FeatureTypes.TEXT_DETECTION)]
vision_client = vision.Client()
image = vision_client.image(source_uri="<gcs uri>")
annotations = image.detect(features)
if annotations:
    annotation = annotations[0]
        if annotation.texts:
            text = annotation.texts[0].description
else:
    text = None

print(text)

Activity

  1. dhermes commented on Apr 3, 2017

    @dhermes
    dhermes
    on Apr 3, 2017
    Contributor
    More actions

    Thanks for reporting! ISTM this is a bug in the API itself, because for us to detect it in the client we'd need to make two round trips (which is a nontrivial penalty).

    We could add a check locally, maybe with an optional verify=False flag, but I think we should try to discuss with the Vision API team first. @lukesneeringer WDYT?

  2. dhermes
    added
    api: visionIssues related to the Cloud Vision API.
    on Apr 3, 2017
  3. lukesneeringer commented on Apr 3, 2017

    @lukesneeringer
    lukesneeringer
    on Apr 3, 2017
    Contributor
    More actions

    I would rather not, because then six other languages have to do that, too. This is an API bug.

  4. lukesneeringer
    closed this as completedon Apr 3, 2017
  5. lukesneeringer commented on Apr 4, 2017

    @lukesneeringer
    lukesneeringer
    on Apr 4, 2017
    Contributor
    More actions

    I have been pointing folks here.

  6. parthea
    added a commit that references this issue on Oct 21, 2023

    [kms] fix flaky test [(#3268)](GoogleCloudPlatform/python-docs-sample…

    82c6aa4
  7. parthea
    added a commit that references this issue on Jun 19, 2024

    chore(deps): bump urllib3 from 2.0.7 to 2.2.2 in /.kokoro (#12803)

    bedc2ae
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: visionIssues related to the Cloud Vision API.

    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.