diff --git a/lib/charms/grafana_agent/v0/cos_agent.py b/lib/charms/grafana_agent/v0/cos_agent.py index 259a901..5bf9a3d 100644 --- a/lib/charms/grafana_agent/v0/cos_agent.py +++ b/lib/charms/grafana_agent/v0/cos_agent.py @@ -251,7 +251,8 @@ class _MetricsEndpointDict(TypedDict): class CosAgentProviderUnitData(pydantic.BaseModel): """Unit databag model for `cos-agent` relation.""" - + class Config: + arbitrary_types_allowed = True # The following entries are the same for all units of the same principal. # Note that the same grafana agent subordinate may be related to several apps. # this needs to make its way to the gagent leader @@ -273,7 +274,8 @@ class CosAgentProviderUnitData(pydantic.BaseModel): class CosAgentPeersUnitData(pydantic.BaseModel): """Unit databag model for `peers` cos-agent machine charm peer relation.""" - + class Config: + arbitrary_types_allowed = True # We need the principal unit name and relation metadata to be able to render identifiers # (e.g. topology) on the leader side, after all the data moves into peer data (the grafana # agent leader can only see its own principal, because it is a subordinate charm). diff --git a/requirements.txt b/requirements.txt index 6cdf37d..fa5035b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ git+https://github.com/canonical/operator#egg=ops git+https://github.com/canonical/charm-relation-interfaces.git@main jinja2 < 3 markupsafe == 2.0.1 -pydantic < 2 +pydantic > 2