Page MenuHomeElementl

Handle LegacyVersion
ClosedPublic

Authored by jordansanders on Jun 28 2021, 8:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 11, 5:58 PM
Unknown Object (File)
Tue, May 9, 1:31 AM
Unknown Object (File)
Sat, May 6, 4:37 PM
Unknown Object (File)
Apr 30 2023, 7:27 AM
Unknown Object (File)
Apr 24 2023, 5:02 AM
Unknown Object (File)
Apr 13 2023, 4:14 AM
Unknown Object (File)
Mar 29 2023, 12:03 AM
Unknown Object (File)
Mar 28 2023, 11:54 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