From 65645ac2b4ea7bf7547d8b8853f910a42e97152c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Tue, 29 Aug 2023 09:56:20 -0600 Subject: [PATCH] Disable json serde --- tap_athena/client.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tap_athena/client.py b/tap_athena/client.py index 8aead4d..c1a8c08 100644 --- a/tap_athena/client.py +++ b/tap_athena/client.py @@ -4,8 +4,12 @@ import typing as t +import sqlalchemy from singer_sdk import SQLConnector, SQLStream +if t.TYPE_CHECKING: + from sqlalchemy.engine import Engine + class AthenaConnector(SQLConnector): """The connector for SQLite. @@ -34,6 +38,17 @@ def get_sqlalchemy_url(self, config: dict[str, t.Any]) -> str: f"schema={config['schema_name']}" ) + def create_engine(self) -> Engine: + """Create a SQLAlchemy engine.""" + return sqlalchemy.create_engine( + self.sqlalchemy_url, + echo=False, + # TODO: Enable JSON serialization/deserialization. + # https://github.com/MeltanoLabs/tap-athena/issues/35 + # json_serializer=self.serialize_json, + # json_deserializer=self.deserialize_json, + ) + class AthenaStream(SQLStream): """The Stream class for Athena."""