HomeElementl

Handle LegacyVersion

Description

Handle LegacyVersion

Summary:
packaging.version.parse can return either a Version or a LegacyVersion.
LegacyVersion doesn't have a major attribute:

python_modules/libraries/dagstermill/dagstermill/compat.py:5: error: Item "LegacyVersion" of "Union[LegacyVersion, Version]" has no attribute "major" [union-attr]

While it's probably safe to assume that Papermill will never publish a
non-parsable version, I'm switching this to safely handle occurances
when parse returns a LegacyVersion instead of ignoring the mypy warning.

Test Plan: unit

Reviewers: max, dgibson

Reviewed By: dgibson

Differential Revision: https://dagster.phacility.com/D8577

Details

Provenance
jordansandersAuthored on Jun 28 2021, 8:22 PM
Reviewer
dgibson
Differential Revision
D8577: Handle LegacyVersion
Parents
R1:b7b2ef5fea06: [dagit] Copy-to-clipboard fallback for unsupported contexts
Branches
Unknown
Tags
Unknown