ferruzzi commented on code in PR #27823:
URL: https://github.com/apache/airflow/pull/27823#discussion_r1041523771
##########
airflow/providers/amazon/aws/hooks/base_aws.py:
##########
@@ -451,22 +542,36 @@ def get_session(self, region_name: str | None = None) ->
boto3.session.Session:
conn=self.conn_config, region_name=region_name, config=self.config
).create_session()
+ def _get_config(self, config: Config | None = None) -> Config:
+ """
+ No AWS Operators use the config argument to this method.
+ Keep backward compatibility with other users who might use it
+ """
+ if config is None:
+ config = deepcopy(self.config)
+
+ # ignore[union-attr] is required for this block to appease MyPy
+ # because the user_agent_extra field is generated at runtime.
+ user_agent_config = Config(
+ user_agent_extra=self._generate_user_agent_extra_field(
+ existing_user_agent_extra=config.user_agent_extra # type:
ignore[union-attr]
Review Comment:
After a while trying to figure out the problem with the S3 test, this is the
root. If I remove the default value on line 414 above, then the S3 test
passes, but then conifg here is possibly a NoneType and causes issues.
I think the solution is to find a better default value for L414 which passes
the values from Connection() in.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]