Skip to content

Compatibility issue with asynch==0.3.0 #374

@mayty

Description

@mayty

Describe the bug
Cannot open a connection to ClickHouse with asynch==0.3.0 installed:

self = <clickhouse_sqlalchemy.drivers.asynch.connector.AsyncAdapt_asynch_dbapi object at 0x73b49b457680>
args = ('clickhouse://test:test@127.0.0.1:9000/test',), kwargs = {}

    def connect(self, *args, **kwargs) -> 'AsyncAdapt_asynch_connection':
        return AsyncAdapt_asynch_connection(
            self,
>           await_only(self.asynch.connect(*args, **kwargs))
        )
E       AttributeError: module 'asynch' has no attribute 'connect'. Did you mean: 'connection'?

.../clickhouse_sqlalchemy/drivers/asynch/connector.py:149: AttributeError

To Reproduce

from asyncio import run
from sqlalchemy.ext.asyncio import create_async_engine


async def main() -> None:
    engine = create_async_engine('clickhouse+asynch://test:test@127.0.0.1:9000/test')

    connection = await engine.connect()

run(main())

Expected behavior
Connection is successful

Versions
asynch==0.3.0
clickhouse-sqlalchemy==0.3.2
Python 3.12.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions