You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "SameerMesiah97 (via GitHub)" <gi...@apache.org> on 2026/10/05 19:45:49 UTC
[PR] Remove redundant Snowflake prefixes from Cortex Agent and SQL API modules [airflow]
SameerMesiah97 opened a new pull request, #74300:
URL: https://github.com/apache/airflow/pull/74300
**Description**
This change renames the Snowflake Cortex Agent hook and operator modules to `cortex_agent.py`, and the SQL API hook module to `sql_api.py`.
Imports, mock targets, corresponding test filenames, documentation and provider metadata are updated to use the new module paths.
**Rationale**
The `snowflake_` prefix repeats information already provided by the `airflow.providers.snowflake` package. Removing it makes these module paths shorter while retaining descriptive filenames and keeping class names unchanged.
**Tests**
- Updated existing hook and operator tests to use the new module paths.
- Added compatibility tests verifying that old imports emit deprecation warnings and resolve to the same classes as the new imports.
**Backwards Compatibility**
Existing import paths remain available through `add_deprecated_classes()` mappings in the hook and operator packages. Existing DAGs continue to work, with deprecation warnings directing users to the new paths.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove redundant Snowflake prefixes from Cortex Agent and SQL API modules [airflow]
Posted by "SameerMesiah97 (via GitHub)" <gi...@apache.org>.
SameerMesiah97 commented on code in PR #74300:
URL: https://github.com/apache/airflow/pull/74300#discussion_r4303137142
##########
providers/snowflake/docs/operators/cortex_agent.rst:
##########
@@ -66,7 +66,7 @@ SnowflakeCortexAgentCreateOperator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove redundant Snowflake prefixes from Cortex Agent and SQL API modules [airflow]
Posted by "SameerMesiah97 (via GitHub)" <gi...@apache.org>.
SameerMesiah97 commented on PR #74300:
URL: https://github.com/apache/airflow/pull/74300#issuecomment-6129200264
Requesting review for this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove redundant Snowflake prefixes from Cortex Agent and SQL API modules [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 merged PR #74300:
URL: https://github.com/apache/airflow/pull/74300
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove redundant Snowflake prefixes from Cortex Agent and SQL API modules [airflow]
Posted by "SameerMesiah97 (via GitHub)" <gi...@apache.org>.
SameerMesiah97 commented on code in PR #74300:
URL: https://github.com/apache/airflow/pull/74300#discussion_r4303127882
##########
providers/snowflake/src/airflow/providers/snowflake/hooks/__init__.py:
##########
@@ -14,3 +14,20 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+
+from __future__ import annotations
+
+from airflow.utils.deprecation_tools import add_deprecated_classes
+
+__deprecated_classes = {
+ "snowflake_cortex_agent": {
+ "SnowflakeCortexAgentHook": (
+ "airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook"
+ ),
+ },
+ "snowflake_sql_api": {
+ "SnowflakeSqlApiHook": ("airflow.providers.snowflake.hooks.sql_api.SnowflakeSqlApiHook"),
+ },
+}
+
+add_deprecated_classes(__deprecated_classes, __name__)
Review Comment:
Added a compatiblity test `test_deprecated_import`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove redundant Snowflake prefixes from Cortex Agent and SQL API modules [airflow]
Posted by "SameerMesiah97 (via GitHub)" <gi...@apache.org>.
SameerMesiah97 commented on code in PR #74300:
URL: https://github.com/apache/airflow/pull/74300#discussion_r4303126555
##########
providers/snowflake/src/airflow/providers/snowflake/hooks/__init__.py:
##########
@@ -14,3 +14,20 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+
+from __future__ import annotations
+
+from airflow.utils.deprecation_tools import add_deprecated_classes
+
+__deprecated_classes = {
+ "snowflake_cortex_agent": {
+ "SnowflakeCortexAgentHook": (
+ "airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook"
Review Comment:
Both `JsonResponse` and `CreateMode` have now been added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove redundant Snowflake prefixes from Cortex Agent and SQL API modules [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on code in PR #74300:
URL: https://github.com/apache/airflow/pull/74300#discussion_r4302995244
##########
providers/snowflake/docs/operators/cortex_agent.rst:
##########
@@ -66,7 +66,7 @@ SnowflakeCortexAgentCreateOperator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Review Comment:
Please add `docs/redirects.txt` entry, otherwise docs may break
##########
providers/snowflake/src/airflow/providers/snowflake/hooks/__init__.py:
##########
@@ -14,3 +14,20 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+
+from __future__ import annotations
+
+from airflow.utils.deprecation_tools import add_deprecated_classes
+
+__deprecated_classes = {
+ "snowflake_cortex_agent": {
+ "SnowflakeCortexAgentHook": (
+ "airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook"
Review Comment:
The hook shim maps only `SnowflakeCortexAgentHook`. `CreateMode` and `JsonResponse` shipped in 6.19.0 but are not mapped. On the PR head, from `airflow.providers.snowflake.hooks.snowflake_cortex_agent import CreateMode` raises `ImportError: cannot import name 'CreateMode' ... (unknown location)`.
##########
providers/snowflake/src/airflow/providers/snowflake/hooks/__init__.py:
##########
@@ -14,3 +14,20 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+
+from __future__ import annotations
+
+from airflow.utils.deprecation_tools import add_deprecated_classes
+
+__deprecated_classes = {
+ "snowflake_cortex_agent": {
+ "SnowflakeCortexAgentHook": (
+ "airflow.providers.snowflake.hooks.cortex_agent.SnowflakeCortexAgentHook"
+ ),
+ },
+ "snowflake_sql_api": {
+ "SnowflakeSqlApiHook": ("airflow.providers.snowflake.hooks.sql_api.SnowflakeSqlApiHook"),
+ },
+}
+
+add_deprecated_classes(__deprecated_classes, __name__)
Review Comment:
Compatibility tests seems to be missing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org