This repository was archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
This repository was archived by the owner on Sep 5, 2023. It is now read-only.
MessageToDict and ParseDict fail on Instance #19
Copy link
Copy link
Closed
Labels
api: memcacheIssues related to the googleapis/python-memcache API.Issues related to the googleapis/python-memcache API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
ipdb> result
name: "projects/polidea-airflow/locations/europe-north1/instances/test-memorystore-memcached-1"
labels {
key: "airflow-version"
value: "v2-0-0-dev0"
}
authorized_network: "projects/project-name/global/networks/default"
zones: "europe-north1-a"
zones: "europe-north1-b"
zones: "europe-north1-c"
node_count: 1
node_config {
cpu_count: 1
memory_size_mb: 1024
}
memcache_version: MEMCACHE_1_5
parameters {
}
memcache_nodes {
node_id: "node-c-1"
zone: "europe-north1-c"
state: READY
host: "######"
port: 11211
parameters {
}
}
create_time {
seconds: 1602506221
nanos: 813043718
}
update_time {
seconds: 1602506527
nanos: 277737323
}
state: READY
memcache_full_version: "memcached-1.5.16"
discovery_endpoint: "######:11211"
ipdb> type(result)
<class 'google.cloud.memcache_v1beta2.types.cloud_memcache.Instance'>
ipdb> MessageToDict(result)
*** AttributeError: 'DESCRIPTOR'
[2020-09-25 12:32:12,847] {cloud_memorystore.py:680} INFO - Instance not exists.
[2020-09-25 12:32:12,849] {taskinstance.py:1337} ERROR - 'DESCRIPTOR'
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/proto/message.py", line 520, in __getattr__
pb_type = self._meta.fields[key].pb_type
KeyError: 'DESCRIPTOR'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/airflow/airflow/models/taskinstance.py", line 1076, in _run_raw_task
self._prepare_and_execute_task_with_callbacks(context, task)
File "/opt/airflow/airflow/models/taskinstance.py", line 1198, in _prepare_and_execute_task_with_callbacks
result = self._execute_task(context, task_copy)
File "/opt/airflow/airflow/models/taskinstance.py", line 1243, in _execute_task
result = task_copy.execute(context=context)
File "/opt/airflow/airflow/providers/google/cloud/operators/cloud_memorystore.py", line 1291, in execute
metadata=self.metadata,
File "/opt/airflow/airflow/providers/google/common/hooks/base_google.py", line 373, in inner_wrapper
return func(self, *args, **kwargs)
File "/opt/airflow/airflow/providers/google/cloud/hooks/cloud_memorystore.py", line 683, in create_instance
instance = ParseDict(instance, cloud_memcache.Instance())
File "/usr/local/lib/python3.7/site-packages/google/protobuf/json_format.py", line 452, in ParseDict
parser.ConvertMessage(js_dict, message)
File "/usr/local/lib/python3.7/site-packages/google/protobuf/json_format.py", line 476, in ConvertMessage
message_descriptor = message.DESCRIPTOR
File "/usr/local/lib/python3.7/site-packages/proto/message.py", line 525, in __getattr__
raise AttributeError(str(ex))
AttributeError: 'DESCRIPTOR
- OS type and version: Debian GNU/Linux 10 (buster) (docker)
- Python version:Python 3.7.9`
- pip version: 20.2.3
google-cloud-memcacheversion: 0.2.0
Other relate packages:
googleapis-common-protos 1.52.0
proto-plus 1.10.0
protobuf 3.13.0
tanjinP
Metadata
Metadata
Assignees
Labels
api: memcacheIssues related to the googleapis/python-memcache API.Issues related to the googleapis/python-memcache API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.