canonical / data-platform-libs

A collection of charm libraries curated by the Data Platform Team
https://charmhub.io/data-platform-libs
Apache License 2.0
9 stars 7 forks source link

[POC] "Back to databag" (i.e. `dict` representation of Abstract Relation Data #143

Open juditnovak opened 4 months ago

juditnovak commented 4 months ago

See how it works on ZooKeeper: https://github.com/canonical/zookeeper-operator/pull/122

If the concept is welcome, I'm adding the tests

juditnovak commented 3 months ago

Summary of the offline conversation with @welpaolo :

juditnovak commented 3 months ago

@welpaolo I was an idiot. (Let's hope it's past tense :rofl: )

We need two separate objects.

Data (here still called DataRelation) is bound to a relation-name.

While the dict is representing a specific relation within that "name".

So we can't do better than as_dict(relation_id) :-/

Sorry I was thinking on a wrong track :-/