apache-airflow-providers-snowflake 5.5.2__py3-none-any.whl → 5.6.0__py3-none-any.whl

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 apache-airflow-providers-snowflake might be problematic. Click here for more details.

@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "5.5.2"
32
+ __version__ = "5.6.0"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.7.0"
@@ -28,8 +28,9 @@ def get_provider_info():
28
28
  "name": "Snowflake",
29
29
  "description": "`Snowflake <https://www.snowflake.com/>`__\n",
30
30
  "state": "ready",
31
- "source-date-epoch": 1718605422,
31
+ "source-date-epoch": 1720423840,
32
32
  "versions": [
33
+ "5.6.0",
33
34
  "5.5.2",
34
35
  "5.5.1",
35
36
  "5.5.0",
@@ -50,7 +50,8 @@ def _try_to_boolean(value: Any):
50
50
 
51
51
 
52
52
  class SnowflakeHook(DbApiHook):
53
- """A client to interact with Snowflake.
53
+ """
54
+ A client to interact with Snowflake.
54
55
 
55
56
  This hook requires the snowflake_conn_id connection. The snowflake account, login,
56
57
  and, password field must be setup in the connection. Other inputs can be defined
@@ -128,6 +129,7 @@ class SnowflakeHook(DbApiHook):
128
129
  "authenticator": "snowflake oauth",
129
130
  "private_key_file": "private key",
130
131
  "session_parameters": "session parameters",
132
+ "client_request_mfa_token": "client request mfa token",
131
133
  },
132
134
  indent=1,
133
135
  ),
@@ -155,6 +157,7 @@ class SnowflakeHook(DbApiHook):
155
157
  self.schema = kwargs.pop("schema", None)
156
158
  self.authenticator = kwargs.pop("authenticator", None)
157
159
  self.session_parameters = kwargs.pop("session_parameters", None)
160
+ self.client_request_mfa_token = kwargs.pop("client_request_mfa_token", None)
158
161
  self.query_ids: list[str] = []
159
162
 
160
163
  def _get_field(self, extra_dict, field_name):
@@ -181,7 +184,8 @@ class SnowflakeHook(DbApiHook):
181
184
 
182
185
  @cached_property
183
186
  def _get_conn_params(self) -> dict[str, str | None]:
184
- """Fetch connection params as a dict.
187
+ """
188
+ Fetch connection params as a dict.
185
189
 
186
190
  This is used in ``get_uri()`` and ``get_connection()``.
187
191
  """
@@ -194,6 +198,7 @@ class SnowflakeHook(DbApiHook):
194
198
  role = self._get_field(extra_dict, "role") or ""
195
199
  insecure_mode = _try_to_boolean(self._get_field(extra_dict, "insecure_mode"))
196
200
  schema = conn.schema or ""
201
+ client_request_mfa_token = _try_to_boolean(self._get_field(extra_dict, "client_request_mfa_token"))
197
202
 
198
203
  # authenticator and session_parameters never supported long name so we don't use _get_field
199
204
  authenticator = extra_dict.get("authenticator", "snowflake")
@@ -216,6 +221,9 @@ class SnowflakeHook(DbApiHook):
216
221
  if insecure_mode:
217
222
  conn_config["insecure_mode"] = insecure_mode
218
223
 
224
+ if client_request_mfa_token:
225
+ conn_config["client_request_mfa_token"] = client_request_mfa_token
226
+
219
227
  # If private_key_file is specified in the extra json, load the contents of the file as a private key.
220
228
  # If private_key_content is specified in the extra json, use it as a private key.
221
229
  # As a next step, specify this private key in the connection configuration.
@@ -280,7 +288,9 @@ class SnowflakeHook(DbApiHook):
280
288
  **{
281
289
  k: v
282
290
  for k, v in conn_params.items()
283
- if v and k not in ["session_parameters", "insecure_mode", "private_key"]
291
+ if v
292
+ and k
293
+ not in ["session_parameters", "insecure_mode", "private_key", "client_request_mfa_token"]
284
294
  }
285
295
  )
286
296
 
@@ -291,7 +301,8 @@ class SnowflakeHook(DbApiHook):
291
301
  return conn
292
302
 
293
303
  def get_sqlalchemy_engine(self, engine_kwargs=None):
294
- """Get an sqlalchemy_engine object.
304
+ """
305
+ Get an sqlalchemy_engine object.
295
306
 
296
307
  :param engine_kwargs: Kwargs used in :func:`~sqlalchemy.create_engine`.
297
308
  :return: the created engine.
@@ -348,7 +359,8 @@ class SnowflakeHook(DbApiHook):
348
359
  return_last: bool = True,
349
360
  return_dictionaries: bool = False,
350
361
  ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None:
351
- """Run a command or list of commands.
362
+ """
363
+ Run a command or list of commands.
352
364
 
353
365
  Pass a list of SQL statements to the SQL parameter to get them to
354
366
  execute sequentially. The result of the queries is returned if the
@@ -152,7 +152,8 @@ class CopyFromExternalStageToSnowflakeOperator(BaseOperator):
152
152
  def _extract_openlineage_unique_dataset_paths(
153
153
  query_result: list[dict[str, Any]],
154
154
  ) -> tuple[list[tuple[str, str]], list[str]]:
155
- """Extract and return unique OpenLineage dataset paths and file paths that failed to be parsed.
155
+ """
156
+ Extract and return unique OpenLineage dataset paths and file paths that failed to be parsed.
156
157
 
157
158
  Each row in the results is expected to have a 'file' field, which is a URI.
158
159
  The function parses these URIs and constructs a set of unique OpenLineage (namespace, name) tuples.
@@ -34,7 +34,8 @@ def fix_account_name(name: str) -> str:
34
34
 
35
35
 
36
36
  def fix_snowflake_sqlalchemy_uri(uri: str) -> str:
37
- """Fix snowflake sqlalchemy connection URI to OpenLineage structure.
37
+ """
38
+ Fix snowflake sqlalchemy connection URI to OpenLineage structure.
38
39
 
39
40
  Snowflake sqlalchemy connection URI has following structure:
40
41
  'snowflake://<user_login_name>:<password>@<account_identifier>/<database_name>/<schema_name>?warehouse=<warehouse_name>&role=<role_name>'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-snowflake
3
- Version: 5.5.2
3
+ Version: 5.6.0
4
4
  Summary: Provider package apache-airflow-providers-snowflake for Apache Airflow
5
5
  Keywords: airflow-provider,snowflake,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
@@ -31,8 +31,8 @@ Requires-Dist: snowflake-sqlalchemy>=1.4.0
31
31
  Requires-Dist: apache-airflow-providers-common-sql ; extra == "common.sql"
32
32
  Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
33
33
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
34
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-snowflake/5.5.2/changelog.html
35
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-snowflake/5.5.2
34
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-snowflake/5.6.0/changelog.html
35
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-snowflake/5.6.0
36
36
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
37
37
  Project-URL: Source Code, https://github.com/apache/airflow
38
38
  Project-URL: Twitter, https://twitter.com/ApacheAirflow
@@ -84,7 +84,7 @@ Provides-Extra: openlineage
84
84
 
85
85
  Package ``apache-airflow-providers-snowflake``
86
86
 
87
- Release: ``5.5.2``
87
+ Release: ``5.6.0``
88
88
 
89
89
 
90
90
  `Snowflake <https://www.snowflake.com/>`__
@@ -97,7 +97,7 @@ This is a provider package for ``snowflake`` provider. All classes for this prov
97
97
  are in ``airflow.providers.snowflake`` python package.
98
98
 
99
99
  You can find package information and changelog for the provider
100
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-snowflake/5.5.2/>`_.
100
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-snowflake/5.6.0/>`_.
101
101
 
102
102
  Installation
103
103
  ------------
@@ -144,4 +144,4 @@ Dependent package
144
144
  ============================================================================================================== ===============
145
145
 
146
146
  The changelog for the provider package can be found in the
147
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-snowflake/5.5.2/changelog.html>`_.
147
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-snowflake/5.6.0/changelog.html>`_.
@@ -1,20 +1,20 @@
1
1
  airflow/providers/snowflake/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
2
- airflow/providers/snowflake/__init__.py,sha256=Za2FwaQkAz1hqOofbW5IhxrSUCbcLOZECaMdJma376E,1496
3
- airflow/providers/snowflake/get_provider_info.py,sha256=uriVMER_1pjB3EV6Yw7YMy60iTEpYKxA7WHrhhUkgXk,4926
2
+ airflow/providers/snowflake/__init__.py,sha256=L5RyPb469F362GFs1KFmcRDsiRSCMt8sF4P8ecoNIi0,1496
3
+ airflow/providers/snowflake/get_provider_info.py,sha256=E2-2AsaJJc861WIkHv44ClpSlOh-e3uehaV0EjxSlgo,4947
4
4
  airflow/providers/snowflake/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
5
- airflow/providers/snowflake/hooks/snowflake.py,sha256=KSV4uy27884NFiHI7A6Ol0GJBW_2JjrDqXqxSz0yi-k,20954
5
+ airflow/providers/snowflake/hooks/snowflake.py,sha256=uCGBqsScQdDxYiN9EgtioSOtwr73A061Nnfjc4hw5Pk,21436
6
6
  airflow/providers/snowflake/hooks/snowflake_sql_api.py,sha256=ljm6v0CCeej7WyrK3IB6F6p954s5FRgEsocfUCQ83Is,14777
7
7
  airflow/providers/snowflake/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
8
8
  airflow/providers/snowflake/operators/snowflake.py,sha256=Evn8RfBTjLaSqrj7Dkhvu2-ewJoY6miTUFMiTTVd_dA,26383
9
9
  airflow/providers/snowflake/transfers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
10
- airflow/providers/snowflake/transfers/copy_into_snowflake.py,sha256=iV3JasS9U4pBHU_-kKFCAxiPRCBZWOzjMURaItAvgoc,12501
10
+ airflow/providers/snowflake/transfers/copy_into_snowflake.py,sha256=ABkUcnpR1DaUH7CowxgcB7tT21nZslOnJ9xLWSegyuc,12510
11
11
  airflow/providers/snowflake/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
12
12
  airflow/providers/snowflake/triggers/snowflake_trigger.py,sha256=YfMA7IXq3T7voUishTi171-8nIotPFzhYeFboSrHHAg,4223
13
13
  airflow/providers/snowflake/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
14
14
  airflow/providers/snowflake/utils/common.py,sha256=DG-KLy2KpZWAqZqm_XIECm8lmdoUlzwkXv9onmkQThc,1644
15
- airflow/providers/snowflake/utils/openlineage.py,sha256=PanpjG1YZlXfxqNjJCL7gNgRU1Gk-P0cj4j2qyf3mrA,2673
15
+ airflow/providers/snowflake/utils/openlineage.py,sha256=b4qfJbMiTJNNhL0jMnRqff6DX5eyOaUYVnmJrEeqULY,2678
16
16
  airflow/providers/snowflake/utils/sql_api_generate_jwt.py,sha256=9mR-vHIquv60tfAni87f6FAjKsiRHUDDrsVhzw4M9vM,6762
17
- apache_airflow_providers_snowflake-5.5.2.dist-info/entry_points.txt,sha256=bCrl5J1PXUMzbgnrKYho61rkbL2gHRT4I6f_1jlxAX4,105
18
- apache_airflow_providers_snowflake-5.5.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
19
- apache_airflow_providers_snowflake-5.5.2.dist-info/METADATA,sha256=KgymXCPW7CrvbyfUWwXVghLvJNgn4XO3k8bD5uJdwDM,6938
20
- apache_airflow_providers_snowflake-5.5.2.dist-info/RECORD,,
17
+ apache_airflow_providers_snowflake-5.6.0.dist-info/entry_points.txt,sha256=bCrl5J1PXUMzbgnrKYho61rkbL2gHRT4I6f_1jlxAX4,105
18
+ apache_airflow_providers_snowflake-5.6.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
19
+ apache_airflow_providers_snowflake-5.6.0.dist-info/METADATA,sha256=TAUl7RenaXd8PxNH6IKYY5IzoCqjHRgyg-iKUu7yezw,6938
20
+ apache_airflow_providers_snowflake-5.6.0.dist-info/RECORD,,