You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "s0neq (via GitHub)" <gi...@apache.org> on 2023/02/20 15:39:33 UTC

[GitHub] [airflow] s0neq commented on a diff in pull request #29635: YandexCloud provider: support Yandex SDK feature "endpoint"

s0neq commented on code in PR #29635:
URL: https://github.com/apache/airflow/pull/29635#discussion_r1112105457


##########
airflow/providers/yandex/hooks/yandex.py:
##########
@@ -122,7 +127,8 @@ def __init__(
         self.connection = self.get_connection(self.connection_id)
         self.extras = self.connection.extra_dejson
         credentials = self._get_credentials()
-        self.sdk = yandexcloud.SDK(user_agent=self.provider_user_agent(), **credentials)
+        endpoint = self._get_field("endpoint", False)
+        self.sdk = yandexcloud.SDK(user_agent=self.provider_user_agent(), endpoint=endpoint, **credentials)

Review Comment:
   thanks for the comment! 
   False is OK because here we initialize yandexcloud.SDK that sets default API endpoint in case it's missing:
   https://github.com/yandex-cloud/python-sdk/blob/master/yandexcloud/_channels.py#L24
   
   we didn't set endpoint until now, so in these tests no endpoint is passed into hooks  https://github.com/apache/airflow/blob/main/tests/system/providers/yandex/example_yandexcloud.py
   



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