You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Aatirhassanpir (via GitHub)" <gi...@apache.org> on 2025/01/23 18:23:14 UTC
[I] Title Fix incorrect exception type for `extra_args` in `S3Hook` and improve validation. [airflow]
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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Title Fix incorrect exception type for `extra_args` in `S3Hook` and improve validation. [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #45978:
URL: https://github.com/apache/airflow/issues/45978#issuecomment-2612342087
AI bot
--
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
Re: [I] Title Fix incorrect exception type for `extra_args` in `S3Hook` and improve validation. [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal closed issue #45978: Title Fix incorrect exception type for `extra_args` in `S3Hook` and improve validation.
URL: https://github.com/apache/airflow/issues/45978
--
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