Aatirhassanpir opened a new issue, #45978:
URL: https://github.com/apache/airflow/issues/45978
### Apache Airflow Provider(s)
microsoft-azure
### Versions of Apache Airflow Providers
apache-airflow-providers-amazon==6.0.0
### Apache Airflow version
Apache Airflow 2.4.3
### Operating System
windows 11
### Deployment
Amazon (AWS) MWAA
### Deployment details
_No response_
### What happened
When passing an invalid type to the `extra_args` parameter in `S3Hook`, the
code incorrectly raised a `ValueError` instead of a `TypeError`. This
inconsistency could cause confusion and make error handling less predictable.
Additionally, there was limited test coverage to validate incorrect inputs for
the `transfer_config_args` parameter.
### What you think should happen instead
The `extra_args` parameter should raise a `TypeError`, similar to the
`transfer_config_args` parameter, ensuring consistency in error handling. The
validation logic should check for incorrect input types and provide meaningful
error messages. Additional unit tests should cover various invalid input
scenarios to improve code reliability.
### How to reproduce
Install the `apache-airflow-providers-amazon` package.
2. Create an `S3Hook` instance with an invalid `extra_args` value:
```python
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
S3Hook(extra_args=1) # This should raise a TypeError
Observe the error message raised.
Similarly, provide an invalid value for transfer_config_args:
python
Copy
Edit
S3Hook(transfer_config_args="invalid_string")
Ensure that appropriate exceptions are raised for invalid input types.
css
Copy
Edit
This report outlines the problem clearly and provides all necessary details
for
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]