Skip to content

Commit

Permalink
Fix 1.0.0 issues (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasium authored Nov 10, 2023
1 parent 7cda9b4 commit 01bbc49
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Changelog
=========

1.0.1
-----

Bugfixes
~~~~~~~~
- Version 1.0.0 states that ``is_distinct_from`` is supported, but the dialect specified
``supports_is_distinct_from=False``. The value was changed to ``True``
- Fixed an issue causing ``is_not_distinct_from`` to fail with an SQL syntax error
- Make sure that ``Text`` types are really rendered as ``UnicodeText``
- Removed misleading ``get_dbapi_type`` from ``Boolean``

1.0.0
-----

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sqlalchemy-hana"
version = "1.0.0"
version = "1.0.1"
description = "SQLAlchemy dialect for SAP HANA"
keywords = ["sqlalchemy", "sap", "hana"]
requires-python = "~=3.8"
Expand Down
7 changes: 3 additions & 4 deletions sqlalchemy_hana/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def visit_is_distinct_from_binary(
f"AND NOT ({left} IS NULL AND {right} IS NULL))"
)

def visit_isnot_distinct_from_binary(
def visit_is_not_distinct_from_binary(
self, binary: BinaryExpression[Any], operator: Any, **kw: Any
) -> str:
left = self.process(binary.left)
Expand Down Expand Up @@ -420,12 +420,11 @@ class HANAHDBCLIDialect(default.DefaultDialect):
requires_name_normalize = True

colspecs = {
types.Boolean: hana_types.BOOLEAN,
types.Date: hana_types.DATE,
types.Time: hana_types.TIME,
types.DateTime: hana_types.TIMESTAMP,
types.LargeBinary: hana_types.HanaBinary,
types.Text: hana_types.HanaText,
types.Text: hana_types.HanaUnicodeText,
types.UnicodeText: hana_types.HanaUnicodeText,
}

Expand All @@ -439,7 +438,7 @@ class HANAHDBCLIDialect(default.DefaultDialect):
div_is_floordiv = False
supports_schemas = True
supports_sane_rowcount = False
supports_is_distinct_from = False
supports_is_distinct_from = True

max_identifier_length = 127

Expand Down
14 changes: 0 additions & 14 deletions sqlalchemy_hana/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ def __init__(
)


class BOOLEAN(sqltypes.Boolean):
def get_dbapi_type(self, dbapi: ModuleType) -> Any | None:
return dbapi.NUMBER


class DATE(sqltypes.Date):
def literal_processor(self, dialect: Dialect) -> Callable[[Any], str]:
self.bind_processor(dialect)
Expand Down Expand Up @@ -93,11 +88,6 @@ def process(value: Any) -> Any | None:
return process


class HanaText(_LOBMixin, sqltypes.Text):
def get_dbapi_type(self, dbapi: ModuleType) -> Any | None:
return dbapi.CLOB


class HanaUnicodeText(_LOBMixin, sqltypes.UnicodeText):
def get_dbapi_type(self, dbapi: ModuleType) -> Any | None:
return dbapi.NCLOB
Expand Down Expand Up @@ -125,7 +115,3 @@ def get_dbapi_type(self, dbapi: ModuleType) -> Any | None:

def bind_processor(self, dialect: Dialect) -> None:
return None


class NCLOB(sqltypes.Text):
__visit_name__ = "NCLOB"

0 comments on commit 01bbc49

Please sign in to comment.