1inuxoid commented on code in PR #29452:
URL: https://github.com/apache/airflow/pull/29452#discussion_r1120345887


##########
airflow/providers/amazon/aws/transfers/dynamodb_to_s3.py:
##########
@@ -135,7 +156,7 @@ def execute(self, context: Context) -> None:
                 raise e
             finally:
                 if err is None:
-                    _upload_file_to_s3(f, self.s3_bucket_name, 
self.s3_key_prefix, self.aws_conn_id)
+                    _upload_file_to_s3(f, self.s3_bucket_name, 
self.s3_key_prefix, str(self.dest_aws_conn_id))

Review Comment:
   @Taragolis if I were to change the signature of `_upload_file_to_s3` to 
extend the type of `aws_conn_id` to `str | ArgNotSet | None` to match 
`dest_aws_conn_id`, I have a problem with S3Hook which only expects `str | 
None` and we're passing `dest_aws_conn_id` there.
   
   I tried this inside constructor, but that didn't help me:
   ```python
           if dest_aws_conn_id is NOTSET:
               self.dest_aws_conn_id = self.source_aws_conn_id
           elif isinstance(dest_aws_conn_id, str):
               self.dest_aws_conn_id = dest_aws_conn_id
           else:
               self.dest_aws_conn_id = None
   ```
   
   Strangely enough, ArgNotSet part of the type still escapes. Would you have 
any suggestions?



-- 
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]

Reply via email to