canonical / canonical/data-platform-libs

[data_interfaces] JujuVersion.from_environ() is deprecated since Ops 2.19

Open
#217 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Recently I noticed the following warning when using data_interfaces:

```
data_interfaces.py:998: DeprecationWarning: JujuVersion.from_environ() is deprecated, use self.model.juju_version instead
self._jujuversion = JujuVersion.from_environ()
```

In Ops 2.19.0 we added [`Model.juju_version`](https://ops.readthedocs.io/en/latest/reference/ops.html#ops.Model.juju_version) and marked `JujuVersion.from_environ()` as deprecated.

Since data_interfaces requires Ops 2.0.0 or above (in [`PYDEPS`](https://github.com/canonical/data-platform-libs/blob/main/lib/charms/data_platform_libs/v0/data_interfaces.py#L336)), I'm not sure whether it would be possible to drop support for `JujuVersion.from_environ()` in data_interfaces. But I thought it would be useful to ask a couple of questions:

- Is there a minimum Ops version that needs to be supported by data_interfaces?

- If data_interfaces needs to support Ops versions prior to 2.19.0, would it be worth adding conditional logic to avoid the warning in newer Ops versions?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.