From 6331a3a0002d07cfaedee5b275e0489f359a4bba Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 16 Jan 2024 23:48:49 +0100 Subject: [PATCH] Dialect: Fix SQLAlchemy entrypoint The dialect as designated by the `crate` dialect identifier was still pointing to the `crate` package. Now, it is assigned to this one instead. --- pyproject.toml | 4 ++-- src/sqlalchemy_cratedb/dialect.py | 3 +++ tests/__init__.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c8c748cc..c53ec82d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,7 +84,7 @@ dynamic = [ ] dependencies = [ 'backports.zoneinfo<1; python_version < "3.9"', - "crate", + "crate @ git+https://github.com/crate/crate-python.git@no-sqlalchemy", "geojson<4,>=2.5", 'importlib-resources; python_version < "3.9"', "sqlalchemy<2.1,>=1", @@ -120,7 +120,7 @@ documentation = "https://github.com/crate-workbench/sqlalchemy-cratedb" homepage = "https://github.com/crate-workbench/sqlalchemy-cratedb" repository = "https://github.com/crate-workbench/sqlalchemy-cratedb" [project.entry-points."sqlalchemy.dialects"] -crate = "sqlalchemy_cratedb:CrateDialect" +crate = "sqlalchemy_cratedb.dialect:dialect" [tool.black] line-length = 80 diff --git a/src/sqlalchemy_cratedb/dialect.py b/src/sqlalchemy_cratedb/dialect.py index 2ed0953d..ed901f9a 100644 --- a/src/sqlalchemy_cratedb/dialect.py +++ b/src/sqlalchemy_cratedb/dialect.py @@ -367,3 +367,6 @@ def has_ilike_operator(self): class DateTrunc(functions.GenericFunction): name = "date_trunc" type = sqltypes.TIMESTAMP + + +dialect = CrateDialect diff --git a/tests/__init__.py b/tests/__init__.py index 3584363a..874c0431 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,7 +2,7 @@ from sqlalchemy_cratedb.compat.api13 import monkeypatch_amend_select_sa14, monkeypatch_add_connectionfairy_driver_connection from sqlalchemy_cratedb.sa_version import SA_1_4, SA_VERSION -from crate.client.test_util import ParametrizedTestCase +from .util import ParametrizedTestCase # `sql.select()` of SQLAlchemy 1.3 uses old calling semantics, # but the test cases already need the modern ones.