fix: accept **kwargs in Bool.__init__ for SQLAlchemy type compatibility#706
Conversation
|
I have read the CLA Document and I hereby sign the CLA. |
|
Thanks for the fix @Bahtya! If you could just update the CHANGELOG and sign the CLA we'll be good to merge. Thanks. |
|
Thanks @joe-clickhouse! I have signed the CLA. I will update the CHANGELOG shortly. |
a81ad37 to
440e4a2
Compare
|
Hi @joe-clickhouse, I've added the CHANGELOG entry. Regarding the CLA, I'll sign it shortly. Thanks for the quick review! |
|
Hey @MrSyta to officially sign the CLA you'll need to actually click on the link https://cla-assistant.io/ClickHouse/clickhouse-connect?pullRequest=706 and click through the acknowledgment there. Thanks! |
|
@joe-clickhouse Thank you for the guidance. I see the CLA needs to be signed through the web interface at the cla-assistant.io link. I'll complete that step shortly. The CHANGELOG entry is already added. Apologies for the delay! |
|
@Bahtya hope you don't mind, but I moved the changelog note to the unreleased section and added a minimal regression test. Thanks again for the work! |
Problem
Using
Boolfromclickhouse_connect.cc_sqlalchemy.datatypes.sqltypesin SQLAlchemy ORM models fails with:This makes the
Booltype unusable in ORM models.Root Cause
SQLAlchemy internally copies/adapts types by calling
__init__(**kwargs)with additional keyword arguments like_create_events. TheBool.__init__only acceptstype_def, so these extra kwargs cause a TypeError.Solution
Accept
**kwargsinBool.__init__and forward them toSqlaBoolean.__init__(self, **kwargs).Fixes #705