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

Skip to content

Commit 25e9da7

Browse files
author
Jesse
authored
Fix SQLAlchemy timestamp converter + docs (databricks#117)
--------- Signed-off-by: Jesse Whitehouse <[email protected]>
1 parent 398ab44 commit 25e9da7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples/sqlalchemy.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
more of the Databricks API, particularly around table reflection, Alembic usage, and data
55
ingestion with pandas.
66
7+
Expected URI format is: databricks+thrift://token:dapi***@***.cloud.databricks.com?http_path=/sql/***
8+
79
Because of the extent of SQLAlchemy's capabilities it isn't feasible to provide examples of every
810
usage in a single script, so we only provide a basic one here. More examples are found in our test
911
suite at tests/e2e/sqlalchemy/test_basic.py and in the PR that implements this change:

src/databricks/sqlalchemy/dialect/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DatabricksTimestamp(types.TypeDecorator):
4747
impl = types.TIMESTAMP
4848

4949
def process_result_value(self, value, dialect):
50-
return processors.str_to_datetime(value)
50+
return value
5151

5252
def adapt(self, impltype, **kwargs):
5353
return self.impl
@@ -59,7 +59,7 @@ class DatabricksDate(types.TypeDecorator):
5959
impl = types.DATE
6060

6161
def process_result_value(self, value, dialect):
62-
return processors.str_to_date(value)
62+
return value
6363

6464
def adapt(self, impltype, **kwargs):
6565
return self.impl

0 commit comments

Comments
 (0)