Skip to content

Commit 86423b4

Browse files
authored
Remove deprecated S3ToSnowflake and SnowflakeToSlack operators (#33558)
* Remove deprecated `S3ToSnowflake` and `SnowflakeToSlack` operators * Update relevant docs and add breaking changes
1 parent af0a4a0 commit 86423b4

File tree

11 files changed

+38
-654
lines changed

11 files changed

+38
-654
lines changed

airflow/providers/snowflake/CHANGELOG.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@
2727
Changelog
2828
---------
2929

30+
5.0.0
31+
.....
32+
33+
Breaking changes
34+
~~~~~~~~~~~~~~~~
35+
36+
.. warning::
37+
Removed deprecated ``S3ToSnowflakeOperator`` in favor of ``CopyFromExternalStageToSnowflakeOperator``.
38+
The parameter that was passed as ``s3_keys`` needs to be changed to ``files``, and the behavior should stay the same.
39+
40+
Removed deprecated ``SnowflakeToSlackOperator`` in favor of ``SqlToSlackOperator`` from Slack Provider.
41+
Parameters that were passed as ``schema``, ``role``, ``database``, ``warehouse`` need to be included into
42+
``sql_hook_params`` parameter, and the behavior should stay the same.
43+
44+
3045
4.4.2
3146
.....
3247

airflow/providers/snowflake/provider.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,10 @@ hooks:
8484
- airflow.providers.snowflake.hooks.snowflake_sql_api
8585

8686
transfers:
87-
- source-integration-name: Amazon Simple Storage Service (S3)
88-
target-integration-name: Snowflake
89-
python-module: airflow.providers.snowflake.transfers.s3_to_snowflake
90-
how-to-guide: /docs/apache-airflow-providers-snowflake/operators/s3_to_snowflake.rst
91-
- source-integration-name: Snowflake
92-
target-integration-name: Slack
93-
python-module: airflow.providers.snowflake.transfers.snowflake_to_slack
94-
how-to-guide: /docs/apache-airflow-providers-snowflake/operators/snowflake_to_slack.rst
9587
- source-integration-name: Amazon Simple Storage Service (S3)
9688
target-integration-name: Snowflake
9789
python-module: airflow.providers.snowflake.transfers.copy_into_snowflake
90+
how-to-guide: /docs/apache-airflow-providers-snowflake/operators/copy_into_snowflake.rst
9891
- source-integration-name: Google Cloud Storage (GCS)
9992
target-integration-name: Snowflake
10093
python-module: airflow.providers.snowflake.transfers.copy_into_snowflake

airflow/providers/snowflake/transfers/s3_to_snowflake.py

Lines changed: 0 additions & 149 deletions
This file was deleted.

airflow/providers/snowflake/transfers/snowflake_to_slack.py

Lines changed: 0 additions & 118 deletions
This file was deleted.

docs/apache-airflow-providers-snowflake/operators/s3_to_snowflake.rst renamed to docs/apache-airflow-providers-snowflake/operators/copy_into_snowflake.rst

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,34 @@
1717
1818
.. _howto/operator:S3ToSnowflakeOperator:
1919

20-
S3ToSnowflakeOperator
21-
=====================
20+
CopyFromExternalStageToSnowflakeOperator
21+
========================================
2222

23-
Use the :class:`S3ToSnowflakeOperator <airflow.providers.snowflake.transfers.s3_to_snowflake>` to load data stored in `AWS S3 <https://aws.amazon.com/s3/>`__
24-
to a Snowflake table.
23+
Use the :class:`CopyFromExternalStageToSnowflakeOperator <airflow.providers.snowflake.transfers.copy_into_snowflake>`
24+
to load data stored in `AWS S3 <https://aws.amazon.com/s3/>`__,
25+
`Google Cloud Storage <https://cloud.google.com/storage>`__, or
26+
`Azure Blob Storage <https://azure.microsoft.com/products/storage/blobs>`__ to a Snowflake table.
2527

28+
.. note:: This operator is a simple wrapper in top of
29+
`COPY INTO table <https://docs.snowflake.com/en/sql-reference/sql/copy-into-table#>`__ query, and
30+
required `creating stage <https://docs.snowflake.com/en/sql-reference/sql/create-stage>`__ first.
2631

2732
Using the Operator
2833
^^^^^^^^^^^^^^^^^^
2934

3035
Similarly to the :class:`SnowflakeOperator <airflow.providers.snowflake.operators.snowflake>`, use the ``snowflake_conn_id`` and
3136
the additional relevant parameters to establish connection with your Snowflake instance.
3237
This operator will allow loading of one or more named files from a specific Snowflake stage (predefined S3 path). In order to do so
33-
pass the relevant file names to the ``s3_keys`` parameter and the relevant Snowflake stage to the ``stage`` parameter.
38+
pass the relevant file names to the ``files`` parameter and the relevant Snowflake stage to the ``stage`` parameter.
3439
``pattern`` can be used to specify the file names and/or paths match patterns
3540
(see `docs <https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#loading-using-pattern-matching>`__).
3641
``file_format`` can be used to either reference an already existing Snowflake file format or a custom string that defines
3742
a file format (see `docs <https://docs.snowflake.com/en/sql-reference/sql/create-file-format.html>`__).
3843

39-
An example usage of the S3ToSnowflakeOperator is as follows:
44+
An example usage of the CopyFromExternalStageToSnowflakeOperator is as follows:
4045

41-
.. exampleinclude:: /../../tests/system/providers/snowflake/example_s3_to_snowflake.py
46+
.. exampleinclude:: /../../tests/system/providers/snowflake/example_copy_into_snowflake.py
4247
:language: python
43-
:start-after: [START howto_operator_s3_to_snowflake]
44-
:end-before: [END howto_operator_s3_to_snowflake]
48+
:start-after: [START howto_operator_s3_copy_into_snowflake]
49+
:end-before: [END howto_operator_s3_copy_into_snowflake]
4550
:dedent: 4

0 commit comments

Comments
 (0)