-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
aiochclient/aiochclient/types.py
Line 456 in 463533c
| return PY_TYPES_MAPPING[type(value)](value) |
The library looks up types in a map using type(value) and raises an exception if the type does not exist in the map. This means any type derived from those types cannot be passed to the library. This creates errors at runtime for derived types that cannot be caught by type checkers. A common example will be StrEnum values, which are a subtype of str.
It's better to use isinstance(value, tuple(PY_TYPES_MAPPING)) to check for compatible types, and ensure that the underlying connection to ClickHouse accepts the types.
Metadata
Metadata
Assignees
Labels
No labels