You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/27 03:05:32 UTC

[GitHub] [airflow] harishkrao opened a new pull request #20509: Fix for #20032

harishkrao opened a new pull request #20509:
URL: https://github.com/apache/airflow/pull/20509


   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #20032 
   related: #20032 
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   Closes: #20032 
   
   When using the Snowflake provider connector for Airflow, if a region is specified in the connection URI, the connection succeeds. If a region is not specified, the Snowflake instance will take US-West-2 as the default instance, however, the URI is malformed and results in an erroneous connection. This fix forms the URI depending on whether the user specifies the region name or not.
   
   For example, when a region is specified, the URI looks like:
   
   ```
   'snowflake://{user}:{password}@{account}.{region}/{database}/{schema}'
   '?warehouse={warehouse}&role={role}&authenticator={authenticator}'
   
   ```
   If a region is not specified, the URI looks like:
   
   ```
   'snowflake://{user}:{password}@{account}/{database}/{schema}'
   '?warehouse={warehouse}&role={role}&authenticator={authenticator}'
   ```
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
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



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #20509: Fix for #20032

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1001305390


   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) for testing locally, itโ€™s a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better ๐Ÿš€.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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



[GitHub] [airflow] potiuk commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1029180353


   > @mik-laj Makes sense. Why is the latest Airflow constraints pointing to an older version of the providers?
   
   Longer answer:
   
   Often new providers introduce dependency changes that might or might not work with Airlfow, the constraints are "golden" set of dependencies that we know that will work (can be installed and passes all the tests) - not only when we release Airflow, but only in the future when new dependencies are released. This is what we  - as community commit to, and this is also what we maintain (and every new release of airlfow witll automatically have constratints with the latest released providers. Constraints are there to make sure "You can always install Airflow with those constraints and we guarantee they will work fine". 
   
   For the newly released providers - we make a lot of work to make sure they work with previously released airflow versions - for example we run tests to make sure they still can be used with Airflow 2.1.0. However - what we DO NOT guarantee - that you can install the providers together with oher released providers on the older airflow version using single "pip install" operation. Due to complexity of dependencies and their live nature we cannot guarantee that all combinations of providers can be installed "together" in a "single" operation.
   
   We can guarantee however that you should be able to upgrade providers on your own (as long as this version is compatible with your Airlfow version) and we even give you the ways how to do it: see [installation and upgrade scenarios](https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html#installation-and-upgrade-scenarios). 
   
   But - in this case - depending on the set and versions of providers you already have installed, you are responsible to resolve all the conflict dependencies if and when they occur. We cannot guarantee that all combinations and versions of all airflow versions and providers will work. That's probably millions of combinations and I am pretty sure some of them won't work. But when you reduce it to the set of providers that you have and you use PIP to resolve those installs (Without using constraints) you should be able to get the right combination in vast majority of cases. But - it's your work and responsibilty not ours. We do explicitly and deliberately do not put that responsibility on our shoulders. It's yours to bear. 
   
   With great powers (flexibility of installing newer version of providers without upgrading airflow) , comes great responsibilities,
   
   The easiest way to keep up-to-date is just to upgrade Airflow to latest version - as soon as it released or soon after. 
   
   This is the option you always have (or the option or upgrade providers independently between the releases - manually).


-- 
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



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1002091456


   Awesome work, congrats on your first merged pull request!
   


-- 
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



[GitHub] [airflow] potiuk merged pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #20509:
URL: https://github.com/apache/airflow/pull/20509


   


-- 
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



[GitHub] [airflow] mik-laj commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1028341389


   By default, Docker image and constraints files for Apache Airflow v2.3.3 uses snowflake-provider 2.2.3
   https://github.com/apache/airflow/blob/8a962740270a9ecf6b4f910173321b183e7adf4a/constraints-3.9.txt#L120
   Here is guide that explain how to upgrade airflow provider in docker image: https://airflow.apache.org/docs/docker-stack/build.html#example-of-upgrading-airflow-provider-packages


-- 
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



[GitHub] [airflow] NadimYounes commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
NadimYounes commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1028087596


   @potiuk @mik-laj @harishkrao FYI this is still broken in Airflow 2.2.3


-- 
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



[GitHub] [airflow] potiuk edited a comment on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1029180353


   > @mik-laj Makes sense. Why is the latest Airflow constraints pointing to an older version of the providers?
   
   Longer answer:
   
   Often new providers introduce dependency changes that might or might not work with other versions of providers, the constraints are "golden" set of dependencies that we know that will work (can be installed and passes all the tests) - not only when we release Airflow, but only in the future when new dependencies are released. This is what we  - as community commit to, and this is also what we maintain (and every new release of airlfow witll automatically have constratints with the latest released providers. Constraints are there to make sure "You can always install Airflow with those constraints and we guarantee they will work fine". 
   
   For the newly released providers - we make a lot of work to make sure they work with previously released airflow versions - for example we run tests to make sure they still can be used with Airflow 2.1.0. However - what we DO NOT guarantee - that you can install the providers together with oher released providers on the older airflow version using single "pip install" operation. Due to complexity of dependencies and their live nature we cannot guarantee that all combinations of providers can be installed "together" in a "single" operation.
   
   We can guarantee however that you should be able to upgrade providers on your own (as long as this version is compatible with your Airlfow version) and we even give you the ways how to do it: see [installation and upgrade scenarios](https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html#installation-and-upgrade-scenarios). 
   
   But - in this case - depending on the set and versions of providers you already have installed, you are responsible to resolve all the conflict dependencies if and when they occur. We cannot guarantee that all combinations and versions of all airflow versions and providers will work. That's probably millions of combinations and I am pretty sure some of them won't work. But when you reduce it to the set of providers that you have and you use PIP to resolve those installs (Without using constraints) you should be able to get the right combination in vast majority of cases. But - it's your work and responsibilty not ours. 
   
   We explicitly and deliberately do not put that responsibility on our shoulders. It's yours to bear. 
   
   With great powers (flexibility of installing newer version of providers without upgrading airflow) , comes great responsibilities,
   
   The easiest way to keep up-to-date is just to upgrade Airflow to latest version - as soon as it released or soon after. 
   
   This is the option you always have (or the option or upgrade providers independently between the releases - but manually).


-- 
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



[GitHub] [airflow] potiuk edited a comment on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1029180353


   > @mik-laj Makes sense. Why is the latest Airflow constraints pointing to an older version of the providers?
   
   Longer answer:
   
   Often new providers introduce dependency changes that might or might not work with other versions of providers, the constraints are "golden" set of dependencies that we know that will work (can be installed and passes all the tests) - not only when we release Airflow, but only in the future when new dependencies are released. This is what we  - as community commit to, and this is also what we maintain (and every new release of airlfow witll automatically have constratints with the latest released providers. Constraints are there to make sure "You can always install Airflow with those constraints and we guarantee they will work fine". 
   
   For the newly released providers - we make a lot of work to make sure they work with previously released airflow versions - for example we run tests to make sure they still can be used with Airflow 2.1.0. However - what we DO NOT guarantee - that you can install the providers together with oher released providers on the older airflow version using single "pip install" operation. Due to complexity of dependencies and their live nature we cannot guarantee that all combinations of providers can be installed "together" in a "single" operation.
   
   We can guarantee however that you should be able to upgrade providers on your own (as long as this version is compatible with your Airlfow version) and we even give you the ways how to do it: see [installation and upgrade scenarios](https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html#installation-and-upgrade-scenarios). 
   
   But - in this case - depending on the set and versions of providers you already have installed, you are responsible to resolve all the conflict dependencies if and when they occur. We cannot guarantee that all combinations and versions of all airflow versions and providers will work. That's probably millions of combinations and I am pretty sure some of them won't work. But when you reduce it to the set of providers that you have and you use PIP to resolve those installs (Without using constraints) you should be able to get the right combination in vast majority of cases. But - it's your work and responsibilty not ours. 
   
   We explicitly and deliberately do not put that responsibility on our shoulders. It's yours to bear. 
   
   With great powers (flexibility of installing newer version of providers without upgrading airflow) , comes great responsibilities,
   
   The easiest way to keep up-to-date is just to upgrade Airflow to latest version - as soon as it released or soon after. 
   
   This is the option you always have (or the option or upgrade providers independently between the releases - manually).


-- 
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



[GitHub] [airflow] mik-laj commented on pull request #20509: Fix for #20032

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1001802967


   @harishkrao I updated the code to use `snowflake.sqlalchemy.URL` and improved the support for session parameters. Let me know what you think.


-- 
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



[GitHub] [airflow] harishkrao commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
harishkrao commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1028164927


   > @potiuk @mik-laj @harishkrao FYI this is still broken in Airflow 2.2.3
   
   I will take a look. Should I open this PR or create a new one to continue? @potiuk @mik-laj 


-- 
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



[GitHub] [airflow] khalidmammadov commented on a change in pull request #20509: Fix for #20032

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on a change in pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#discussion_r775650614



##########
File path: airflow/providers/snowflake/hooks/snowflake.py
##########
@@ -222,10 +222,17 @@ def get_uri(self) -> str:
         return self._conn_params_to_sqlalchemy_uri(conn_params)
 
     def _conn_params_to_sqlalchemy_uri(self, conn_params: Dict) -> str:
-        uri = (
-            'snowflake://{user}:{password}@{account}.{region}/{database}/{schema}'
+        if conn_params['region'] == '':
+            del conn_params['region']
+            uri = (
+            'snowflake://{user}:{password}@{account}/{database}/{schema}'

Review comment:
       ```suggestion
           region = conn_params.get('region')
           conn_params['region'] = f".{region}" if region else ''
           uri = (
               'snowflake://{user}:{password}@{account}{region}/{database}/{schema}'
               '?warehouse={warehouse}&role={role}&authenticator={authenticator}'
           )
   ```




-- 
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



[GitHub] [airflow] mik-laj commented on a change in pull request #20509: Fix for #20032

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#discussion_r775658597



##########
File path: tests/providers/snowflake/hooks/test_snowflake.py
##########
@@ -388,3 +388,38 @@ def test_connection_failure(self, mock_run):
             assert status is False
             assert msg == 'Connection Errors'
             mock_run.assert_called_once_with(sql='select 1')
+
+    @mock.patch('airflow.providers.snowflake.hooks.snowflake.SnowflakeHook.run')
+    def test_connection_without_region(self, mock_run):

Review comment:
       Can you add this case to the existing parameterized method?
   https://github.com/apache/airflow/blob/e0552c7b4cf53757242c913fdb419ee55c70c459/tests/providers/snowflake/hooks/test_snowflake.py#L75-L203

##########
File path: tests/providers/snowflake/hooks/test_snowflake.py
##########
@@ -388,3 +388,38 @@ def test_connection_failure(self, mock_run):
             assert status is False
             assert msg == 'Connection Errors'
             mock_run.assert_called_once_with(sql='select 1')
+
+    @mock.patch('airflow.providers.snowflake.hooks.snowflake.SnowflakeHook.run')
+    def test_connection_without_region(self, mock_run):

Review comment:
       Can we add this case to the existing parameterized method?
   https://github.com/apache/airflow/blob/e0552c7b4cf53757242c913fdb419ee55c70c459/tests/providers/snowflake/hooks/test_snowflake.py#L75-L203

##########
File path: tests/providers/snowflake/hooks/test_snowflake.py
##########
@@ -388,3 +388,38 @@ def test_connection_failure(self, mock_run):
             assert status is False
             assert msg == 'Connection Errors'
             mock_run.assert_called_once_with(sql='select 1')
+
+    @mock.patch('airflow.providers.snowflake.hooks.snowflake.SnowflakeHook.run')

Review comment:
       Is it needed?




-- 
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



[GitHub] [airflow] potiuk edited a comment on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1029180353


   > @mik-laj Makes sense. Why is the latest Airflow constraints pointing to an older version of the providers?
   
   Longer answer:
   
   Often new providers introduce dependency changes that might or might not work with other versions of providers, the constraints are "golden" set of dependencies that we know that will work (can be installed and passes all the tests) - not only when we release Airflow, but only in the future when new dependencies are released. This is what we  - as community commit to, and this is also what we maintain (and every new release of airlfow witll automatically have constratints with the latest released providers. Constraints are there to make sure "You can always install Airflow with those constraints and we guarantee they will work fine". 
   
   For the newly released providers - we make a lot of work to make sure they work with previously released airflow versions - for example we run tests to make sure they still can be used with Airflow 2.1.0. However - what we DO NOT guarantee - that you can install the providers together with oher released providers on the older airflow version using single "pip install" operation. Due to complexity of dependencies and their live nature we cannot guarantee that all combinations of providers can be installed "together" in a "single" operation.
   
   We can guarantee however that you should be able to upgrade providers on your own (as long as this version is compatible with your Airlfow version) and we even give you the ways how to do it: see [installation and upgrade scenarios](https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html#installation-and-upgrade-scenarios). 
   
   But - in this case - depending on the set and versions of providers you already have installed, you are responsible to resolve all the conflict dependencies if and when they occur. We cannot guarantee that all combinations and versions of all airflow versions and providers will work. That's probably millions of combinations and I am pretty sure some of them won't work. But when you reduce it to the set of providers that you have and you use PIP to resolve those installs (Without using constraints) you should be able to get the right combination in vast majority of cases. But - it's your work and responsibilty not ours. We do explicitly and deliberately do not put that responsibility on our shoulders. It's yours to bear. 
   
   With great powers (flexibility of installing newer version of providers without upgrading airflow) , comes great responsibilities,
   
   The easiest way to keep up-to-date is just to upgrade Airflow to latest version - as soon as it released or soon after. 
   
   This is the option you always have (or the option or upgrade providers independently between the releases - manually).


-- 
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



[GitHub] [airflow] NadimYounes commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
NadimYounes commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1028490179


   @mik-laj Makes sense. Why is the latest Airflow constraints pointing to an older version of the providers?


-- 
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



[GitHub] [airflow] mik-laj commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1028506624


   @NadimYounes Because it is only created once when a new version of Airflow is released. Only when we notice a critical problem, we sometimes make additional changes to it  e.g. https://github.com/apache/airflow/pull/20245
   


-- 
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



[GitHub] [airflow] mik-laj commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1028339363


   @harishkrao @NadimYounes  What version of Snowflake provider are you using?  This change has been released in apache-airflow-providers-snowflake v2.4.0. To check the version of the package, you can run the `pip freeze` command.
   


-- 
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



[GitHub] [airflow] harishkrao commented on pull request #20509: Fix for #20032

Posted by GitBox <gi...@apache.org>.
harishkrao commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1001870911


   > @harishkrao I updated the code to use `snowflake.sqlalchemy.URL` and improved the support for session parameters. Let me know what you think.
   
   @mik-laj 
   Thank you for updating the code to use URL. I agree that it is the better way to generate URIs. I tried it and ran into issues with the session parameters and insecure mode arguments when running tests. I see that you simply dropped the two keys when generating the URI, that looks good to me :) 


-- 
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



[GitHub] [airflow] khalidmammadov commented on a change in pull request #20509: Fix for #20032

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on a change in pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#discussion_r775650614



##########
File path: airflow/providers/snowflake/hooks/snowflake.py
##########
@@ -222,10 +222,17 @@ def get_uri(self) -> str:
         return self._conn_params_to_sqlalchemy_uri(conn_params)
 
     def _conn_params_to_sqlalchemy_uri(self, conn_params: Dict) -> str:
-        uri = (
-            'snowflake://{user}:{password}@{account}.{region}/{database}/{schema}'
+        if conn_params['region'] == '':
+            del conn_params['region']
+            uri = (
+            'snowflake://{user}:{password}@{account}/{database}/{schema}'

Review comment:
       ```suggestion
           region = conn_params.get('region')
           conn_params['region'] = f".{region}" if region else ''
           uri = (
               'snowflake://{user}:{password}@{account}{region}/{database}/{schema}'
   ```




-- 
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



[GitHub] [airflow] harishkrao commented on a change in pull request #20509: Fix for #20032

Posted by GitBox <gi...@apache.org>.
harishkrao commented on a change in pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#discussion_r775727930



##########
File path: tests/providers/snowflake/hooks/test_snowflake.py
##########
@@ -388,3 +388,38 @@ def test_connection_failure(self, mock_run):
             assert status is False
             assert msg == 'Connection Errors'
             mock_run.assert_called_once_with(sql='select 1')
+
+    @mock.patch('airflow.providers.snowflake.hooks.snowflake.SnowflakeHook.run')

Review comment:
       @mik-laj  Just saw that you modified the pytest connection parameters to allow a blank value for region. I attempted to write the same, but unsuccessfully, so added a new test. This is not needed, now that you have added the params.




-- 
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



[GitHub] [airflow] github-actions[bot] commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1002091483


   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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



[GitHub] [airflow] potiuk commented on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1002091381


   I will include that one in the december release tool


-- 
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



[GitHub] [airflow] mik-laj edited a comment on pull request #20509: Improvements for `SnowflakeHook.get_sqlalchemy_engine`

Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on pull request #20509:
URL: https://github.com/apache/airflow/pull/20509#issuecomment-1028506624


   @NadimYounes Because it is only created once when a new version of Airflow is released. Only when we notice a critical problem, we sometimes make additional changes to it  e.g. https://github.com/apache/airflow/pull/20245 
   


-- 
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