dapr / python-sdk

Dapr SDK for Python
Apache License 2.0
221 stars 125 forks source link

[BUG] configuration api returns unexpected type #720

Closed akshaya-a closed 1 month ago

akshaya-a commented 3 months ago

Expected Behavior

i expected config_response.items[key].json() to be a valid method based on the typing (dapr.clients.grpc._response.py::ConfigurationItem)

Actual Behavior

assert isinstance(client, DaprClient) config_response = client.get_configuration( CONFIGURATION_STORE, keys=[CONFIGURATION_KEY] )

(Pdb) config_response.items[CONFIGURATION_KEY].json() *** AttributeError: json (Pdb) config_response.items[CONFIGURATION_KEY].value '{"store":{"store_type":"none"},"events":{"events_ty...

(Pdb) type(config_response.items[CONFIGURATION_KEY]) <class 'dapr.proto.common.v1.common_pb2.ConfigurationItem'>

seems to be returning the autogenned typedefs

Steps to Reproduce the Problem

INFO[0000] Starting Dapr Runtime -- version 1.13.2 -- commit f09b193d8ac62bef6c0fd5452a00d2a49cd0d134 app_id=tests instance=ubuntudev scope=dapr.runtime type=log ver=1.13.2 (base) ak@ubuntudev:~/mindctrl$ pip show dapr Name: dapr Version: 1.13.0

Release Note

RELEASE NOTE: