Skip to content

sqlalchemy 2.0 compatibility#3

Open
SaboteurInCave wants to merge 1 commit intousizy:sa-2.0from
SaboteurInCave:sa-2.0
Open

sqlalchemy 2.0 compatibility#3
SaboteurInCave wants to merge 1 commit intousizy:sa-2.0from
SaboteurInCave:sa-2.0

Conversation

@SaboteurInCave
Copy link

Hello, @PedroAquilino !

I want to contribute some SQLAlchemy 2.0 compability changes into your PR.
Please, review and accept or decline them.

Cheers!

  • fixes #

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Ensure PR doesn't contain untouched code reformatting: spaces, etc.
  • Run flake8 and fix issues.
  • Run pytest no tests failed. See https://clickhouse-sqlalchemy.readthedocs.io/en/latest/development.html.

@SaboteurInCave
Copy link
Author

At the current time, i have an issue with test InsertTestCase.test_insert(self) (InsertTestCase in tests.sql.test_insert):

self = <clickhouse_sqlalchemy.drivers.native.connector.Cursor object at 0x0000024F900F7250>
operation = "INSERT INTO t (x) VALUES ('test')", seq_of_parameters = [{}]
context = <clickhouse_sqlalchemy.drivers.native.base.ClickHouseExecutionContext object at 0x0000024F900F7790>

    def executemany(self, operation, seq_of_parameters, context=None):
        self._reset_state()
        self._begin_query()
    
        try:
            execute, execute_kwargs = self._prepare(context)
    
            response = execute(
                operation, params=seq_of_parameters, **execute_kwargs
            )
    
        except DriverError as orig:
>           raise DatabaseException(orig)
E           clickhouse_sqlalchemy.exceptions.DatabaseException: Orig exception: Code: 102. Unexpected packet from server localhost:9000 (expected Data, Exception, Log or TableColumns, got Progress)

clickhouse_sqlalchemy\drivers\native\connector.py:175: DatabaseException

Can you reproduce it in your branch?

@SaboteurInCave
Copy link
Author

Hello again! I remind you about my PR (sqlaclhemy 2.0 support)

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant