Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Opentelemetry WARNING: Invalid type NoneType for attribute value. #1140

@kamilglod

Description

@kamilglod

Environment details

  • OS type and version: docker image python:3.9.5-slim-buster
  • Python version: 3.9.5
  • pip version: 21.1.2
  • google-cloud-bigquery version: 2.32.0
  • opentelemetry-sdk verision: 1.9.1

Steps to reproduce

  1. Setup any load job with opentelemetry enabled
  2. See warning about passing None as span attribute

Stack trace

(opentelemetry.attributes) WARNING: Invalid type NoneType for attribute value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types

In _set_job_attributes() function (https://github.com/googleapis/python-bigquery/blob/main/google/cloud/bigquery/opentelemetry_tracing.py#L113) you are passing parent_job_id argument which might be None. None is invalid attribute type for opentelemetry: https://github.com/open-telemetry/opentelemetry-python/blob/45a2b350e54da9f99a718148d257ee4e28b1d8e4/opentelemetry-api/src/opentelemetry/attributes/__init__.py#L69-L79

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/python-bigquery API.priority: p2Moderately-important priority. Fix may not be included in 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