-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed type hinting for handler function #42275
Changed type hinting for handler function #42275
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
How about a test that makes sure your use case doesn't fail now? |
As the change includes only type hinting, I think it would be too restrictive to also enforce it as a test, as types in python are not strict |
If @romsharon98 agrees with you, so no problem |
I agree with @Ariel2400 |
Co author: rom sharon @romsharon
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
* Changed type hinting for handler function * Fixed ruff type hinting * Changed from iterable to list * Update sql.pyi for IDE support * Complied to the fetch_all_handler signature * Changed signature in pyi * Fixed import error * Fixed missing import * Reordered imports * Reordered imports * Removed plus sign * Removed plus sign * Conformed to pep8 * Update sql.pyi * Fixed bad type error * Update sql.pyi Co author: rom sharon @romsharon --------- Co-authored-by: rom sharon <[email protected]>
Due to changes introduced in #36205, we experienced breakage in our SQLExecuteQueryOperator. In short, our assumption was that the handler is able to also transform the data type returned from the query. For example our handler looked something like this:
As that was changed, that led to errors in our dags. We now moved to use the
_process_output
method as we should’ve done in the first place, but we this type hint will prevent further confusion as to what are the constraints of the handler passed to the operator.