Skip to content

Commit 0394c2f

Browse files
authored
feat: deprecate juju_topology v0 (#123)
1 parent 17393f3 commit 0394c2f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/charms/observability_libs/v0/juju_topology.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
```
6868
6969
"""
70+
71+
import warnings
7072
from collections import OrderedDict
7173
from typing import Dict, List, Optional
7274
from uuid import UUID
@@ -119,6 +121,13 @@ def __init__(
119121
unit: a unit name as a string
120122
charm_name: name of charm as a string
121123
"""
124+
warnings.warn(
125+
"""
126+
observability_libs.v0.juju_topology is deprecated. Please import the
127+
library from `cosl` instead: https://github.com/canonical/cos-lib
128+
""",
129+
DeprecationWarning,
130+
)
122131
if not self.is_valid_uuid(model_uuid):
123132
raise InvalidUUIDError(model_uuid)
124133

@@ -215,7 +224,8 @@ def as_dict(
215224

216225
if remapped_keys:
217226
ret = OrderedDict(
218-
(remapped_keys.get(k), v) if remapped_keys.get(k) else (k, v) for k, v in ret.items() # type: ignore
227+
(remapped_keys.get(k), v) if remapped_keys.get(k) else (k, v)
228+
for k, v in ret.items() # type: ignore
219229
)
220230

221231
return ret

0 commit comments

Comments
 (0)