Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f9a40a

Browse files
committed
Array testing 2
1 parent f95903c commit 2f9a40a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/databricks/sqlalchemy/dialect/__init__.py

-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,9 @@
2626
from alembic.ddl import DefaultImpl
2727
from alembic.autogenerate import render
2828

29-
# TODO:
3029
class DatabricksImpl(DefaultImpl):
3130
__dialect__ = "databricks"
3231

33-
def _render_ARRAY_type(self, type_, autogen_context):
34-
return render._render_type_w_subtype(
35-
type_, autogen_context, "item_type", r"(.+?\()"
36-
)
37-
3832

3933
class DatabricksDecimal(types.TypeDecorator):
4034
"""Translates strings to decimals"""

src/databricks/sqlalchemy/dialect/compiler.py

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ def visit_DATETIME(self, type_):
4444

4545
def visit_JSON(self, type_):
4646
return "STRUCT"
47+
48+
def visit_ARRAY(self, type_):
49+
return "ARRAY {type}".format(type=type_.item_type)

0 commit comments

Comments
 (0)