Page MenuHomeElementl

Handle LegacyVersion
ClosedPublic

Authored by jordansanders on Jun 28 2021, 8:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 30, 1:46 AM
Unknown Object (File)
Fri, Jun 24, 5:14 PM
Unknown Object (File)
Wed, Jun 22, 4:55 PM
Unknown Object (File)
Tue, Jun 21, 3:49 PM
Unknown Object (File)
Sun, Jun 19, 10:27 PM
Unknown Object (File)
Wed, Jun 15, 1:06 PM
Unknown Object (File)
Fri, Jun 10, 7:42 AM
Unknown Object (File)
Thu, Jun 9, 12:48 PM
Subscribers
None

Details

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

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable