braincube-io / python-connector

Python client for Braincube APIs
https://braincube-io.github.io/python-connector/
3 stars 1 forks source link

braincube.get_name() is broken #104

Open mathisc opened 9 months ago

mathisc commented 9 months ago

Describe the bug braincube.get_name() is broken (at least on my local stack and internal preprod)

To Reproduce

from braincube_connector import braincube, client

client.get_instance(config_dict={"api_key": api_key, "domain": domain, "verify": False})
bc = braincube.get_braincube(braincube_name)
print(bc.get_name())

I am getting the following error :

python3.10/site-packages/braincube_connector/bases/base_entity.py", line 216, in get_name
    return self._metadata[self.get_parameter_key("name")]
KeyError: 'name'

Likely because name is nested under product (and not under braincube directly) : {'product': {... 'name': 'testBraincube'}}

Expected behavior I expect the name of the braincube instance to show up

Versions: braincube-connector==2.6.0