dagster-snowflake 0.25.8__tar.gz → 0.25.10__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.
Potentially problematic release.
This version of dagster-snowflake might be problematic. Click here for more details.
- {dagster-snowflake-0.25.8/dagster_snowflake.egg-info → dagster-snowflake-0.25.10}/PKG-INFO +1 -1
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake/resources.py +11 -11
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake/snowflake_io_manager.py +5 -4
- dagster-snowflake-0.25.10/dagster_snowflake/version.py +1 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10/dagster_snowflake.egg-info}/PKG-INFO +1 -1
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake.egg-info/requires.txt +1 -1
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/setup.py +2 -3
- dagster-snowflake-0.25.8/dagster_snowflake/version.py +0 -1
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/LICENSE +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/MANIFEST.in +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/README.md +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake/__init__.py +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake/constants.py +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake/ops.py +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake/py.typed +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake.egg-info/SOURCES.txt +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake.egg-info/dependency_links.txt +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake.egg-info/not-zip-safe +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake.egg-info/top_level.txt +0 -0
- {dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dagster-snowflake
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.10
|
|
4
4
|
Summary: Package for Snowflake Dagster framework components.
|
|
5
5
|
Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-snowflake
|
|
6
6
|
Author: Dagster Labs
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import base64
|
|
2
2
|
import sys
|
|
3
3
|
import warnings
|
|
4
|
+
from collections.abc import Iterator, Mapping, Sequence
|
|
4
5
|
from contextlib import closing, contextmanager
|
|
5
6
|
from datetime import datetime
|
|
6
|
-
from typing import Any,
|
|
7
|
+
from typing import Any, Optional, Union
|
|
7
8
|
|
|
8
9
|
import dagster._check as check
|
|
9
10
|
from cryptography.hazmat.backends import default_backend
|
|
@@ -131,8 +132,8 @@ class SnowflakeResource(ConfigurableResource, IAttachDifferentObjectToOpContext)
|
|
|
131
132
|
"Raw private key to use. See the `Snowflake documentation"
|
|
132
133
|
" <https://docs.snowflake.com/en/user-guide/key-pair-auth.html>`__ for details."
|
|
133
134
|
" Alternately, set private_key_path and private_key_password. To avoid issues with"
|
|
134
|
-
" newlines in the keys, you can base64 encode the key. You can retrieve
|
|
135
|
-
" encoded key with this shell command: ``cat rsa_key.p8 | base64``"
|
|
135
|
+
" newlines in the keys, you can optionally base64 encode the key. You can retrieve"
|
|
136
|
+
" the base64 encoded key with this shell command: ``cat rsa_key.p8 | base64``"
|
|
136
137
|
),
|
|
137
138
|
)
|
|
138
139
|
|
|
@@ -258,7 +259,7 @@ class SnowflakeResource(ConfigurableResource, IAttachDifferentObjectToOpContext)
|
|
|
258
259
|
default=None,
|
|
259
260
|
description="Optional parameter to specify the authentication mechanism to use.",
|
|
260
261
|
)
|
|
261
|
-
additional_snowflake_connection_args: Optional[
|
|
262
|
+
additional_snowflake_connection_args: Optional[dict[str, Any]] = Field(
|
|
262
263
|
default=None,
|
|
263
264
|
description=(
|
|
264
265
|
"Additional keyword arguments to pass to the snowflake.connector.connect function. For a full list of"
|
|
@@ -355,7 +356,7 @@ class SnowflakeResource(ConfigurableResource, IAttachDifferentObjectToOpContext)
|
|
|
355
356
|
@property
|
|
356
357
|
@cached_method
|
|
357
358
|
def _sqlalchemy_connection_args(self) -> Mapping[str, Any]:
|
|
358
|
-
conn_args:
|
|
359
|
+
conn_args: dict[str, Any] = {
|
|
359
360
|
k: self._resolved_config_dict.get(k)
|
|
360
361
|
for k in (
|
|
361
362
|
"account",
|
|
@@ -397,7 +398,7 @@ class SnowflakeResource(ConfigurableResource, IAttachDifferentObjectToOpContext)
|
|
|
397
398
|
with open(config.get("private_key_path"), "rb") as key:
|
|
398
399
|
private_key = key.read()
|
|
399
400
|
else:
|
|
400
|
-
private_key = config.get("private_key", None)
|
|
401
|
+
private_key = config.get("private_key", None).encode()
|
|
401
402
|
|
|
402
403
|
kwargs = {}
|
|
403
404
|
if config.get("private_key_password", None) is not None:
|
|
@@ -409,7 +410,9 @@ class SnowflakeResource(ConfigurableResource, IAttachDifferentObjectToOpContext)
|
|
|
409
410
|
p_key = serialization.load_pem_private_key(
|
|
410
411
|
private_key, backend=default_backend(), **kwargs
|
|
411
412
|
)
|
|
412
|
-
|
|
413
|
+
|
|
414
|
+
# key fails to load, possibly indicating key is base64 encoded
|
|
415
|
+
except ValueError:
|
|
413
416
|
try:
|
|
414
417
|
private_key = base64.b64decode(private_key)
|
|
415
418
|
p_key = serialization.load_pem_private_key(
|
|
@@ -578,9 +581,6 @@ class SnowflakeConnection:
|
|
|
578
581
|
|
|
579
582
|
with self.get_connection() as conn:
|
|
580
583
|
with closing(conn.cursor()) as cursor:
|
|
581
|
-
if sys.version_info[0] < 3:
|
|
582
|
-
sql = sql.encode("utf-8")
|
|
583
|
-
|
|
584
584
|
self.log.info("Executing query: " + sql)
|
|
585
585
|
parameters = dict(parameters) if isinstance(parameters, Mapping) else parameters
|
|
586
586
|
cursor.execute(sql, parameters)
|
|
@@ -631,7 +631,7 @@ class SnowflakeConnection:
|
|
|
631
631
|
if not fetch_results and use_pandas_result:
|
|
632
632
|
check.failed("If use_pandas_result is True, fetch_results must also be True.")
|
|
633
633
|
|
|
634
|
-
results:
|
|
634
|
+
results: list[Any] = []
|
|
635
635
|
with self.get_connection() as conn:
|
|
636
636
|
with closing(conn.cursor()) as cursor:
|
|
637
637
|
for raw_sql in sql_queries:
|
{dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake/snowflake_io_manager.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from abc import abstractmethod
|
|
2
|
+
from collections.abc import Sequence
|
|
2
3
|
from contextlib import contextmanager
|
|
3
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional, cast
|
|
4
5
|
|
|
5
6
|
from dagster import IOManagerDefinition, OutputContext, io_manager
|
|
6
7
|
from dagster._config.pythonic_config import ConfigurableIOManagerFactory
|
|
@@ -22,7 +23,7 @@ SNOWFLAKE_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
|
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
def build_snowflake_io_manager(
|
|
25
|
-
type_handlers: Sequence[DbTypeHandler], default_load_type: Optional[
|
|
26
|
+
type_handlers: Sequence[DbTypeHandler], default_load_type: Optional[type] = None
|
|
26
27
|
) -> IOManagerDefinition:
|
|
27
28
|
"""Builds an IO manager definition that reads inputs from and writes outputs to Snowflake.
|
|
28
29
|
|
|
@@ -279,7 +280,7 @@ class SnowflakeIOManager(ConfigurableIOManagerFactory):
|
|
|
279
280
|
default=None,
|
|
280
281
|
description="Optional parameter to specify the authentication mechanism to use.",
|
|
281
282
|
)
|
|
282
|
-
additional_snowflake_connection_args: Optional[
|
|
283
|
+
additional_snowflake_connection_args: Optional[dict[str, Any]] = Field(
|
|
283
284
|
default=None,
|
|
284
285
|
description=(
|
|
285
286
|
"Additional keyword arguments to pass to the snowflake.connector.connect function. For a full list of"
|
|
@@ -309,7 +310,7 @@ class SnowflakeIOManager(ConfigurableIOManagerFactory):
|
|
|
309
310
|
...
|
|
310
311
|
|
|
311
312
|
@staticmethod
|
|
312
|
-
def default_load_type() -> Optional[
|
|
313
|
+
def default_load_type() -> Optional[type]:
|
|
313
314
|
"""If an asset or op is not annotated with an return type, default_load_type will be used to
|
|
314
315
|
determine which TypeHandler to use to store and load the output.
|
|
315
316
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.25.10"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dagster-snowflake
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.10
|
|
4
4
|
Summary: Package for Snowflake Dagster framework components.
|
|
5
5
|
Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-snowflake
|
|
6
6
|
Author: Dagster Labs
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from typing import Dict
|
|
3
2
|
|
|
4
3
|
from setuptools import find_packages, setup
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
def get_version() -> str:
|
|
8
|
-
version:
|
|
7
|
+
version: dict[str, str] = {}
|
|
9
8
|
with open(Path(__file__).parent / "dagster_snowflake/version.py", encoding="utf8") as fp:
|
|
10
9
|
exec(fp.read(), version)
|
|
11
10
|
|
|
@@ -35,7 +34,7 @@ setup(
|
|
|
35
34
|
include_package_data=True,
|
|
36
35
|
python_requires=">=3.9,<3.13",
|
|
37
36
|
install_requires=[
|
|
38
|
-
"dagster==1.9.
|
|
37
|
+
"dagster==1.9.10",
|
|
39
38
|
"snowflake-connector-python>=3.4.0",
|
|
40
39
|
# Workaround for incorrect pin in the snowflake-connector-python package
|
|
41
40
|
# See https://github.com/snowflakedb/snowflake-connector-python/issues/2109
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.25.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{dagster-snowflake-0.25.8 → dagster-snowflake-0.25.10}/dagster_snowflake.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|