Within the CrateDB-specific statement compiler for SQLAlchemy, there is a patch to support CrateDB's container data types OBJECT and ARRAY. It is located at CrateCompilerSA20.visit_update().
About
SQLAlchemy 2 now wants to convert the crud_params list to a type-safe variant using sqlalchemy.cast().
# TODO: Complete SA20 migration.
# This is the column name/value joining code from SA20.
# It may be sensible to use this procedure instead of the old one.
text += ", ".join(
expr + "=" + value
for _, expr, value, _ in cast(
"List[Tuple[Any, str, str, Any]]", crud_params
)
)
That croaks with:
AttributeError: 'list' object has no attribute '_is_tuple_type'
Code
The relevant code region is this part within CrateCompilerSA20.visit_update:
Introduction
Within the CrateDB-specific statement compiler for SQLAlchemy, there is a patch to support CrateDB's container data types
OBJECT
andARRAY
. It is located atCrateCompilerSA20.visit_update()
.About
SQLAlchemy 2 now wants to convert the
crud_params
list to a type-safe variant usingsqlalchemy.cast()
.That croaks with:
Code
The relevant code region is this part within
CrateCompilerSA20.visit_update
:https://github.com/crate/crate-python/blob/2ee91d52f6e07659c54337fe6bb08caf114e7469/src/crate/client/sqlalchemy/compat/core20.py#L116-L146
Discussion references