flytekitplugins-sqlalchemy 1.10.2__tar.gz → 1.10.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/PKG-INFO +2 -1
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/flytekitplugins/sqlalchemy/task.py +8 -8
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/flytekitplugins_sqlalchemy.egg-info/PKG-INFO +2 -1
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/flytekitplugins_sqlalchemy.egg-info/requires.txt +1 -0
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/setup.py +2 -2
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/tests/test_task.py +1 -1
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/README.md +0 -0
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/flytekitplugins/sqlalchemy/__init__.py +0 -0
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/flytekitplugins_sqlalchemy.egg-info/SOURCES.txt +0 -0
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/flytekitplugins_sqlalchemy.egg-info/dependency_links.txt +0 -0
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/flytekitplugins_sqlalchemy.egg-info/namespace_packages.txt +0 -0
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/flytekitplugins_sqlalchemy.egg-info/top_level.txt +0 -0
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/setup.cfg +0 -0
- {flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/tests/test_sql_tracker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flytekitplugins-sqlalchemy
|
|
3
|
-
Version: 1.10.
|
|
3
|
+
Version: 1.10.3
|
|
4
4
|
Summary: SQLAlchemy plugin for flytekit
|
|
5
5
|
Author: dolthub
|
|
6
6
|
Author-email: max@dolthub.com
|
|
@@ -19,3 +19,4 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
19
19
|
Requires-Python: >=3.8
|
|
20
20
|
Requires-Dist: flytekit<2.0.0,>=1.3.0b2
|
|
21
21
|
Requires-Dist: sqlalchemy>=1.4.7
|
|
22
|
+
Requires-Dist: pandas
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import typing
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
from pandas.io.sql import pandasSQL_builder
|
|
6
|
-
from sqlalchemy import create_engine, text # type: ignore
|
|
7
|
-
|
|
8
|
-
from flytekit import current_context, kwtypes
|
|
4
|
+
from flytekit import current_context, kwtypes, lazy_module
|
|
9
5
|
from flytekit.configuration import SerializationSettings
|
|
10
6
|
from flytekit.configuration.default_images import DefaultImages, PythonVersion
|
|
11
7
|
from flytekit.core.base_sql_task import SQLTask
|
|
@@ -16,6 +12,10 @@ from flytekit.models import task as task_models
|
|
|
16
12
|
from flytekit.models.security import Secret
|
|
17
13
|
from flytekit.types.schema import FlyteSchema
|
|
18
14
|
|
|
15
|
+
pd = lazy_module("pandas")
|
|
16
|
+
pandas_io_sql = lazy_module("pandas.io.sql")
|
|
17
|
+
sqlalchemy = lazy_module("sqlalchemy")
|
|
18
|
+
|
|
19
19
|
|
|
20
20
|
class SQLAlchemyDefaultImages(DefaultImages):
|
|
21
21
|
"""Default images for the sqlalchemy flytekit plugin."""
|
|
@@ -126,7 +126,7 @@ class SQLAlchemyTaskExecutor(ShimTaskExecutor[SQLAlchemyTask]):
|
|
|
126
126
|
value = current_context().secrets.get(group=secret_dict["group"], key=secret_dict["key"])
|
|
127
127
|
tt.custom["connect_args"][key] = value
|
|
128
128
|
|
|
129
|
-
engine = create_engine(tt.custom["uri"], connect_args=tt.custom["connect_args"], echo=False)
|
|
129
|
+
engine = sqlalchemy.create_engine(tt.custom["uri"], connect_args=tt.custom["connect_args"], echo=False)
|
|
130
130
|
logger.info(f"Connecting to db {tt.custom['uri']}")
|
|
131
131
|
|
|
132
132
|
interpolated_query = SQLAlchemyTask.interpolate_query(tt.custom["query_template"], **kwargs)
|
|
@@ -134,7 +134,7 @@ class SQLAlchemyTaskExecutor(ShimTaskExecutor[SQLAlchemyTask]):
|
|
|
134
134
|
with engine.begin() as connection:
|
|
135
135
|
df = None
|
|
136
136
|
if tt.interface.outputs:
|
|
137
|
-
df = pd.read_sql_query(text(interpolated_query), connection)
|
|
137
|
+
df = pd.read_sql_query(sqlalchemy.text(interpolated_query), connection)
|
|
138
138
|
else:
|
|
139
|
-
pandasSQL_builder(connection).execute(text(interpolated_query))
|
|
139
|
+
pandas_io_sql.pandasSQL_builder(connection).execute(sqlalchemy.text(interpolated_query))
|
|
140
140
|
return df
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flytekitplugins-sqlalchemy
|
|
3
|
-
Version: 1.10.
|
|
3
|
+
Version: 1.10.3
|
|
4
4
|
Summary: SQLAlchemy plugin for flytekit
|
|
5
5
|
Author: dolthub
|
|
6
6
|
Author-email: max@dolthub.com
|
|
@@ -19,3 +19,4 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
19
19
|
Requires-Python: >=3.8
|
|
20
20
|
Requires-Dist: flytekit<2.0.0,>=1.3.0b2
|
|
21
21
|
Requires-Dist: sqlalchemy>=1.4.7
|
|
22
|
+
Requires-Dist: pandas
|
|
@@ -4,9 +4,9 @@ PLUGIN_NAME = "sqlalchemy"
|
|
|
4
4
|
|
|
5
5
|
microlib_name = f"flytekitplugins-{PLUGIN_NAME}"
|
|
6
6
|
|
|
7
|
-
plugin_requires = ["flytekit>=1.3.0b2,<2.0.0", "sqlalchemy>=1.4.7"]
|
|
7
|
+
plugin_requires = ["flytekit>=1.3.0b2,<2.0.0", "sqlalchemy>=1.4.7", "pandas"]
|
|
8
8
|
|
|
9
|
-
__version__ = "1.10.
|
|
9
|
+
__version__ = "1.10.3"
|
|
10
10
|
|
|
11
11
|
setup(
|
|
12
12
|
name=microlib_name,
|
|
@@ -205,7 +205,7 @@ def test_task_serialization_deserialization_with_secret(sql_server):
|
|
|
205
205
|
assert r.iat[0, 0] == 1
|
|
206
206
|
|
|
207
207
|
|
|
208
|
-
@mock.patch("flytekit.
|
|
208
|
+
@mock.patch("flytekit.configuration.plugin.FlyteRemote", spec=FlyteRemote)
|
|
209
209
|
@mock.patch("flytekit.clients.friendly.SynchronousFlyteClient", spec=SynchronousFlyteClient)
|
|
210
210
|
def test_register_sql_task(mock_client, mock_remote):
|
|
211
211
|
mock_remote._client = mock_client
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{flytekitplugins-sqlalchemy-1.10.2 → flytekitplugins-sqlalchemy-1.10.3}/tests/test_sql_tracker.py
RENAMED
|
File without changes
|