You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jhbigler (via GitHub)" <gi...@apache.org> on 2023/06/16 19:18:32 UTC
[GitHub] [airflow] jhbigler commented on a diff in pull request #31950: Trino Hook: Add ability to read JWT from file
jhbigler commented on code in PR #31950:
URL: https://github.com/apache/airflow/pull/31950#discussion_r1232642277
##########
airflow/providers/trino/hooks/trino.py:
##########
@@ -95,7 +95,12 @@ def get_conn(self) -> Connection:
elif db.password:
auth = trino.auth.BasicAuthentication(db.login, db.password) # type: ignore[attr-defined]
elif extra.get("auth") == "jwt":
- auth = trino.auth.JWTAuthentication(token=extra.get("jwt__token"))
+ if("jwt__file" in extra):
+ with open(extra.get("jwt__file"), 'r') as jwt_file:
Review Comment:
I'm hesitant to use the bracket notation `extra["..."]` in your suggestion because `extra.get("...")` is used elsewhere in this file before this commit, and I wanted to be consistent with the existing notation. Seems to be used in the code for other providers/hooks, too. I will, however, put in the other suggested changes from the static check
--
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