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 2022/08/04 20:50:24 UTC

[GitHub] [airflow] Taragolis opened a new pull request, #25544: Fix S3Hook transfer config arguments validation

Taragolis opened a new pull request, #25544:
URL: https://github.com/apache/airflow/pull/25544

   Fix incorrect validation for `transfer_config_args`.
   
   Additional reminder for me if something seems simple and do not required tests - this might cause an issues 🙄 


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


[GitHub] [airflow] potiuk merged pull request #25544: Fix S3Hook transfer config arguments validation

Posted by GitBox <gi...@apache.org>.
potiuk merged PR #25544:
URL: https://github.com/apache/airflow/pull/25544


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


[GitHub] [airflow] uranusjr commented on a diff in pull request #25544: Fix S3Hook transfer config arguments validation

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25544:
URL: https://github.com/apache/airflow/pull/25544#discussion_r938419228


##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -128,12 +128,12 @@ def __init__(
         kwargs['client_type'] = 's3'
         kwargs['aws_conn_id'] = aws_conn_id
 
-        if extra_args and not isinstance(extra_args, dict):
-            raise ValueError(f"transfer_config_args '{extra_args!r}' must be of type {dict}")
+        if transfer_config_args and not isinstance(transfer_config_args, dict):
+            raise TypeError(f"transfer_config_args expected dict, got {type(transfer_config_args)}.")
         self.transfer_config = TransferConfig(**transfer_config_args or {})
 
         if extra_args and not isinstance(extra_args, dict):
-            raise ValueError(f"extra_args '{extra_args!r}' must be of type {dict}")
+            raise TypeError(f"extra_args expected dict, got {type(extra_args)}.")

Review Comment:
   ```suggestion
               raise TypeError(f"extra_args expected dict, got {type(extra_args).__name__}.")
   ```
   
   would make the output cleaner



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