Skip to content

Commit

Permalink
Dialect: Fix SQLAlchemy entrypoint
Browse files Browse the repository at this point in the history
The dialect as designated by the `crate` dialect identifier was still
pointing to the `crate` package. Now, it is assigned to this one
instead.
  • Loading branch information
amotl committed Jan 16, 2024
1 parent 2064d6b commit 6331a3a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/sqlalchemy_cratedb/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,6 @@ def has_ilike_operator(self):
class DateTrunc(functions.GenericFunction):
name = "date_trunc"
type = sqltypes.TIMESTAMP


dialect = CrateDialect
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6331a3a

Please sign in to comment.