You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jroachgolf84 (via GitHub)" <gi...@apache.org> on 2025/12/15 16:01:38 UTC
[PR] `issue-59385`: Removing unneeded call the `SnowflakeSqlApiHook` [airflow]
jroachgolf84 opened a new pull request, #59470:
URL: https://github.com/apache/airflow/pull/59470
## Description
@manipatnam noted that each time the Trigger ran for the `SnowflakeSqlApiOperator`, a connection was being made. This issue was tracked down to the `SnowflakeSqlApiTrigger`, where an unnecessary call was being made to `SnowflakeSqlApiHook` each time the trigger ran.
This PR removes that call.
## Testing
To test the changes made in this PR, please run the command shown below. This will run all tests for the Snowflake provider.
```bash
breeze testing providers-tests --test-type "Providers[snowflake]"
```
closes: https://github.com/apache/airflow/issues/59385
--
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] `issue-59385`: Removing unneeded call the `SnowflakeSqlApiHook` [airflow]
Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on code in PR #59470:
URL: https://github.com/apache/airflow/pull/59470#discussion_r2620372628
##########
providers/snowflake/src/airflow/providers/snowflake/triggers/snowflake_trigger.py:
##########
@@ -68,11 +68,6 @@ def serialize(self) -> tuple[str, dict[str, Any]]:
async def run(self) -> AsyncIterator[TriggerEvent]:
"""Wait for the query the snowflake query to complete."""
- SnowflakeSqlApiHook(
Review Comment:
Updated :)
--
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] `issue-59385`: Removing unneeded call the `SnowflakeSqlApiHook` [airflow]
Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on code in PR #59470:
URL: https://github.com/apache/airflow/pull/59470#discussion_r2620331925
##########
providers/snowflake/src/airflow/providers/snowflake/triggers/snowflake_trigger.py:
##########
@@ -68,11 +68,6 @@ def serialize(self) -> tuple[str, dict[str, Any]]:
async def run(self) -> AsyncIterator[TriggerEvent]:
"""Wait for the query the snowflake query to complete."""
- SnowflakeSqlApiHook(
Review Comment:
You are most certainly correct! I'm updating this now.
--
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] `issue-59385`: Removing unneeded call the `SnowflakeSqlApiHook` [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #59470:
URL: https://github.com/apache/airflow/pull/59470
--
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] `issue-59385`: Removing unneeded call the `SnowflakeSqlApiHook` [airflow]
Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on PR #59470:
URL: https://github.com/apache/airflow/pull/59470#issuecomment-3657308409
@rawwar, do you mind taking a peek at this one? Thanks!
--
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] `issue-59385`: Removing unneeded call the `SnowflakeSqlApiHook` [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on code in PR #59470:
URL: https://github.com/apache/airflow/pull/59470#discussion_r2620256433
##########
providers/snowflake/src/airflow/providers/snowflake/triggers/snowflake_trigger.py:
##########
@@ -68,11 +68,6 @@ def serialize(self) -> tuple[str, dict[str, Any]]:
async def run(self) -> AsyncIterator[TriggerEvent]:
"""Wait for the query the snowflake query to complete."""
- SnowflakeSqlApiHook(
Review Comment:
I have less experience with Snowflake but the issue seems to be not about the hook created here since run is called once and more about the hook created here not used in `self.get_query_status`. The method `get_query_status` could reuse the hook instead and recreate it only when the token becomes invalid.
--
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