-
Notifications
You must be signed in to change notification settings - Fork 166
Open
Description
Noticed another path that can end up here (in #3127 (comment)):
Lines 632 to 634 in 1471cbb
if implementation is Implementation.UNKNOWN: # pragma: no cover | |
msg = "Cannot return backend version from UNKNOWN Implementation" | |
raise AssertionError(msg) |
A more reasonable option is to return (0, 0, 0)
early - as that can be used in a guard like:
>>> (0, 20, 4) >= (0, 0, 0)
True
In fact, it works for all MIN_VERSIONS
:
from narwhals._utils import MIN_VERSIONS
UNKNOWN_VERSION = (0, 0, 0)
>>> all(version >= UNKNOWN_VERSION for version in MIN_VERSIONS.values())
True