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 2022/07/20 12:20:40 UTC

[GitHub] [airflow] bdsoha opened a new pull request, #25183: Add auth_type to LivyHook

bdsoha opened a new pull request, #25183:
URL: https://github.com/apache/airflow/pull/25183

   This is directly related to #25179 


-- 
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 #25183: Add auth_type to LivyHook

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

   Merged! :tada: 


-- 
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 #25183: Add auth_type to LivyHook

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

   Just in time for new provider's release.


-- 
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] bdsoha commented on a diff in pull request #25183: Add auth_type to LivyHook

Posted by GitBox <gi...@apache.org>.
bdsoha commented on code in PR #25183:
URL: https://github.com/apache/airflow/pull/25183#discussion_r926316352


##########
airflow/providers/apache/livy/hooks/livy.py:
##########
@@ -75,10 +76,12 @@ def __init__(
         livy_conn_id: str = default_conn_name,
         extra_options: Optional[Dict[str, Any]] = None,
         extra_headers: Optional[Dict[str, Any]] = None,
+        auth_type: Optional[Any] = None
     ) -> None:
         super().__init__(http_conn_id=livy_conn_id)
         self.extra_headers = extra_headers or {}
         self.extra_options = extra_options or {}
+        self.auth_type = auth_type or self.auth_type

Review Comment:
   The inherited `HttpHook` sets a default value to `self.auth_type` which should be used when the argument `auth_type==None`.
   
   It could have also been handled as such:
   1. Using a *ternary statement*:
   ```python
   self.auth_type = auth_type if auth_type  else self.auth_type
   ```
   2. Using an *if-conditional*:
   ```python
   if auth_type:
       self.auth_type = auth_type 
   ```



-- 
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 #25183: Add auth_type to LivyHook

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

   But some fixes are needed @bdsoha if you want to make it on time (tomorrow)


-- 
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] uranusjr commented on a diff in pull request #25183: Add auth_type to LivyHook

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25183:
URL: https://github.com/apache/airflow/pull/25183#discussion_r926305833


##########
airflow/providers/apache/livy/hooks/livy.py:
##########
@@ -75,10 +76,12 @@ def __init__(
         livy_conn_id: str = default_conn_name,
         extra_options: Optional[Dict[str, Any]] = None,
         extra_headers: Optional[Dict[str, Any]] = None,
+        auth_type: Optional[Any] = None
     ) -> None:
         super().__init__(http_conn_id=livy_conn_id)
         self.extra_headers = extra_headers or {}
         self.extra_options = extra_options or {}
+        self.auth_type = auth_type or self.auth_type

Review Comment:
   What does `or self.auth_type` do?



-- 
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 #25183: Add auth_type to LivyHook

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

   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] bdsoha commented on pull request #25183: Add auth_type to LivyHook

Posted by GitBox <gi...@apache.org>.
bdsoha commented on PR #25183:
URL: https://github.com/apache/airflow/pull/25183#issuecomment-1191047722

   I will include those updates, as well as unit-tests and docblocks.
   


-- 
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] bdsoha commented on pull request #25183: Add auth_type to LivyHook

Posted by GitBox <gi...@apache.org>.
bdsoha commented on PR #25183:
URL: https://github.com/apache/airflow/pull/25183#issuecomment-1207400544

   @potiuk The current workflow is failing for *Tests / Postgres10,Py3.7* downgrade step. It passed on the previous execution. No code changes *(only style)* were added to the current commit.


-- 
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 #25183: Add auth_type to LivyHook

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

   You should add unit tests covering it.


-- 
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 #25183: Add auth_type to LivyHook

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


-- 
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] bdsoha commented on a diff in pull request #25183: Add auth_type to LivyHook

Posted by GitBox <gi...@apache.org>.
bdsoha commented on code in PR #25183:
URL: https://github.com/apache/airflow/pull/25183#discussion_r926316352


##########
airflow/providers/apache/livy/hooks/livy.py:
##########
@@ -75,10 +76,12 @@ def __init__(
         livy_conn_id: str = default_conn_name,
         extra_options: Optional[Dict[str, Any]] = None,
         extra_headers: Optional[Dict[str, Any]] = None,
+        auth_type: Optional[Any] = None
     ) -> None:
         super().__init__(http_conn_id=livy_conn_id)
         self.extra_headers = extra_headers or {}
         self.extra_options = extra_options or {}
+        self.auth_type = auth_type or self.auth_type

Review Comment:
   The inherited `HttpHook` sets a default value to `self.auth_type` which should be used when the argument `auth_type==None`.



-- 
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] bdsoha commented on pull request #25183: Add auth_type to LivyHook

Posted by GitBox <gi...@apache.org>.
bdsoha commented on PR #25183:
URL: https://github.com/apache/airflow/pull/25183#issuecomment-1207381699

   @eladkal added unit tests


-- 
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] eladkal commented on pull request #25183: Add auth_type to LivyHook

Posted by GitBox <gi...@apache.org>.
eladkal commented on PR #25183:
URL: https://github.com/apache/airflow/pull/25183#issuecomment-1207165517

   @bdsoha are you still working on this PR? It's missing tests to cover the new functionality.


-- 
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 #25183: Add auth_type to LivyHook

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

   > @potiuk The current workflow is failing for _Tests / Postgres10,Py3.7_ downgrade step. This step passed on the previous execution [48fbd89](https://github.com/apache/airflow/commit/48fbd896c3baf9991666319058b312c7fc6d1421). No code changes _(only style)_ were added to the current commit.
   
   Yep. Re-run it . Looked like an intermittent issue.


-- 
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 #25183: Add auth_type to LivyHook

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

   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