Skip to content
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

Better multiple_outputs inferral for @task.python #20800

Merged
merged 2 commits into from
Jan 27, 2022

Conversation

uranusjr
Copy link
Member

This builds on #19608 and switches the implementation from using inspect.signature() (which uses __annotations__ internally) to typing_extension.get_type_hints() (not the typing one for better backward compatibility) to provide better type resolution from “stringified” annotations. This better supports from __future__ import annotation and other non-define-time resolved annotations.

To improve test writability and readability, TestAirflowTaskDecorator is converted from unittest to pytest-style for better version-based test-skipping fuinctionalities.

cc @josh-fell

@uranusjr uranusjr force-pushed the covert-test-python branch 2 times, most recently from 7209175 to 29b3d8a Compare January 17, 2022 09:05
This switches the implementation from using inspect.signature() (which
uses __annotations__ internally) to typing.get_type_hints() to provide
better type resolution from "stringified" annotations. This better
supports 'from __future__ import annotation' and other non-define-time
resolved annotations.

To improve test writability and readability, TestAirflowTaskDecorator
is converted from unittest to pytest-style for better version-based
test-skipping fuinctionalities.
@uranusjr uranusjr merged commit 6405d8f into apache:main Jan 27, 2022
@uranusjr uranusjr deleted the covert-test-python branch January 27, 2022 06:52
@jedcunningham jedcunningham added the type:improvement Changelog: Improvements label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants