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

int() argument must be a string, a bytes-like object or a number, not 'dict' #105

Closed
pmantaj opened this issue Mar 26, 2021 · 4 comments
Closed
Assignees
Labels
api: monitoring Issues related to the googleapis/python-monitoring API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@pmantaj
Copy link

pmantaj commented Mar 26, 2021

Environment details

  • OS type and version: macOS Big Sur
  • Python version: Python 3.6.10
  • pip version: 21.0.1
  • google-cloud-monitoring version: 2.2.0

Steps to reproduce

  1. Just use the following import from google.cloud import monitoring_v3 in any file.

Code example

from google.cloud import monitoring_v3

Stack trace

  File "venv/lib/python3.6/site-packages/google/cloud/monitoring_v3/__init__.py", line 18, in <module>
    from .services.alert_policy_service import AlertPolicyServiceClient
  File "venv/lib/python3.6/site-packages/google/cloud/monitoring_v3/services/alert_policy_service/__init__.py", line 18, in <module>
    from .client import AlertPolicyServiceClient
  File "venv/lib/python3.6/site-packages/google/cloud/monitoring_v3/services/alert_policy_service/client.py", line 35, in <module>
    from google.cloud.monitoring_v3.services.alert_policy_service import pagers
  File "venv/lib/python3.6/site-packages/google/cloud/monitoring_v3/services/alert_policy_service/pagers.py", line 29, in <module>
    from google.cloud.monitoring_v3.types import alert
  File "venv/lib/python3.6/site-packages/google/cloud/monitoring_v3/types/__init__.py", line 18, in <module>
    from .alert import AlertPolicy
  File "venv/lib/python3.6/site-packages/google/cloud/monitoring_v3/types/alert.py", line 21, in <module>
    from google.cloud.monitoring_v3.types import common
  File "venv/lib/python3.6/site-packages/google/cloud/monitoring_v3/types/common.py", line 51, in <module>
    class ServiceTier(proto.Enum):
  File "venv/lib/python3.6/site-packages/proto/enums.py", line 72, in __new__
    cls = super().__new__(mcls, name, bases, attrs)
  File ".pyenv/versions/3.6.10/lib/python3.6/enum.py", line 201, in __new__
    enum_member = __new__(enum_class, *args)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'

The problem is in the file: google/cloud/monitoring_v3/types/common.py and class ServiceTier(proto.Enum). When I remove the property _pb_options = {"deprecated": True} everything works correctly.

Thanks!

@product-auto-label product-auto-label bot added the api: monitoring Issues related to the googleapis/python-monitoring API. label Mar 26, 2021
@Atixx
Copy link

Atixx commented Mar 26, 2021

Had this same issue when upgrading to 2.2.0 from 2.0.1

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Mar 27, 2021
@busunkim96
Copy link
Contributor

Ah apologies, I missed updating the minimum required version of proto-plus. If you update proto-plus to the latest release (anything >=1.15.0 will work) the error should disappear.

The good news is that we're starting to explicitly test the lower bound (see #102) so this should not happen in the future.

@busunkim96 busunkim96 added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 29, 2021
@busunkim96 busunkim96 self-assigned this Mar 29, 2021
@busunkim96 busunkim96 added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 29, 2021
@busunkim96
Copy link
Contributor

Closed by #102

@busunkim96
Copy link
Contributor

Fix released in 2.2.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: monitoring Issues related to the googleapis/python-monitoring API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants