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: [email protected]
