The YDB SQLAlchemy driver incorrectly infers parameter types, treating UInt64 values as Int64
Problem occurs in the type handling logic of BaseYqlCompiler when processing expanding parameters (IN clauses)
Naked queries work fine in YDB, confirming this is a driver-level issue
query = select(table.c.id).where(
table.c.id.in_(bindparam("ids", type_=ydb_sa_types.ListType(ydb_sa_types.Uint64)))
)
session.execute(query, {"ids": [16140901099660902405]})
Root Cause
The YDB SQLAlchemy driver incorrectly infers parameter types, treating UInt64 values as Int64
Problem occurs in the type handling logic of BaseYqlCompiler when processing expanding parameters (IN clauses)
Naked queries work fine in YDB, confirming this is a driver-level issue
Workarounds
looks the problem from here https://github.com/ydb-platform/ydb-sqlalchemy/blob/0.1.8/ydb_sqlalchemy/sqlalchemy/compiler/base.py#L317