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/04/16 20:39:47 UTC
[GitHub] [airflow] zhzhang opened a new pull request #15412: PostgresHook: deepcopy connection to avoid mutating connection obj
zhzhang opened a new pull request #15412:
URL: https://github.com/apache/airflow/pull/15412
<!--
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: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
PostgresHook: deepcopy connection object to avoid unexpected mutation
---
For AWS IAM based connections, the connection object is mutated by setting the `login`, `password` and `port` properties after the call to `self.get_iam_token(...)`. The connection object's `login` field is set to `"IAM:original-login"` because the `login` value returned has `IAM:` prefixed.
As a result, any subsequent calls to `get_conn()` will fail with the AWS `client.get_cluster_credentials(...)` call complaining that `:` cannot be part of the `DbUser` argument.
In general, the values within any connection objects used by this hook should not be subject to mutation by `get_conn()` calls, and the addition of `deepcopy` is meant to enforce this.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kurtqq commented on pull request #15412: PostgresHook: deepcopy connection to avoid mutating connection obj
Posted by GitBox <gi...@apache.org>.
kurtqq commented on pull request #15412:
URL: https://github.com/apache/airflow/pull/15412#issuecomment-830832357
you need one of the maintainers to approve
@kaxil @dstandish @XD-DENG @xinbinhuang
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] xinbinhuang merged pull request #15412: PostgresHook: deepcopy connection to avoid mutating connection obj
Posted by GitBox <gi...@apache.org>.
xinbinhuang merged pull request #15412:
URL: https://github.com/apache/airflow/pull/15412
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] zhzhang commented on pull request #15412: PostgresHook: deepcopy connection to avoid mutating connection obj
Posted by GitBox <gi...@apache.org>.
zhzhang commented on pull request #15412:
URL: https://github.com/apache/airflow/pull/15412#issuecomment-827779948
Unable to merge still :( what's the best way to get somebody with write access to have a look at this?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] xinbinhuang commented on pull request #15412: PostgresHook: deepcopy connection to avoid mutating connection obj
Posted by GitBox <gi...@apache.org>.
xinbinhuang commented on pull request #15412:
URL: https://github.com/apache/airflow/pull/15412#issuecomment-830843018
@zhzhang Nice catch! thanks for the PR
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] xinbinhuang edited a comment on pull request #15412: PostgresHook: deepcopy connection to avoid mutating connection obj
Posted by GitBox <gi...@apache.org>.
xinbinhuang edited a comment on pull request #15412:
URL: https://github.com/apache/airflow/pull/15412#issuecomment-830843018
@zhzhang @kurtqq Nice catch! thanks for the PR
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org