Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c05fd8

Browse files
author
Jesse Whitehouse
committed
Rename types.py →_types.py
Necessary because it breaks some namespace imports in SQLAlchemy"types.py" is a pretty common package name. Other dialects appear to do thesame underscore prefix approachSigned-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
1 parentefc0337 commit8c05fd8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

‎src/databricks/sqlalchemy/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
fromdatabricksimportsql
1414

1515
# This import is required to process our @compiles decorators
16-
importdatabricks.sqlalchemy.types
16+
importdatabricks.sqlalchemy._types
1717

1818

1919
fromdatabricks.sqlalchemy.baseimport (

‎src/databricks/sqlalchemy/types.py‎renamed to ‎src/databricks/sqlalchemy/_types.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
importsqlalchemy
22
fromsqlalchemy.ext.compilerimportcompiles
33

4+
importdatabricks.sql
45

56
@compiles(sqlalchemy.types.Enum,"databricks")
67
@compiles(sqlalchemy.types.String,"databricks")
@@ -78,3 +79,15 @@ def compile_array_databricks(type_, compiler, **kw):
7879
inner=compiler.process(type_.item_type,**kw)
7980

8081
returnf"ARRAY<{inner}>"
82+
83+
84+
classDatabricksBinaryType(sqlalchemy.types.TypeDecorator):
85+
"""
86+
"""
87+
88+
impl=sqlalchemy.types.BINARY
89+
90+
cache_ok=True
91+
92+
defprocess_bind_param(self,value,dialect):
93+
returndatabricks.sql.BINARY(value)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp