-
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
improve(xcom): validate key in XCom.set() to prevent empty strings #46929
base: main
Are you sure you want to change the base?
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)
|
What Changed
Why This Change?
Related IssueFixes #46925 Notes
|
29ad7c4
to
3a622fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder I'd we should also do something client side in the task sdk
@ashb I’ve applied the suggested change. Let me know if anything else is needed. Thanks! |
7a622e6
to
e6f2801
Compare
e6f2801
to
3ce170d
Compare
3ce170d
to
761da97
Compare
@ashb , @amoghrajesh – Based on #46417 , we were leaning towards the conclusion of not allowing :param key: A key for the XComs. If provided, only XComs with matching keys will be returned. Pass None (default) to remove the filter. I find it useful to allow |
Allowing None/not set on fetch is okay. Set def shouldn't accept None nor empty string though. We'll need to make sure that we handle So to do the But that is a separate PR, and here we're talking about mostly set path, plus ensuring min length on the XCom get makes sense too (as that API end point cant return multiple values) |
Co-authored-by: Ash Berlin-Taylor <[email protected]>
761da97
to
28a2c51
Compare
@ashb - Thanks for sharing your thoughts and clarifying my doubts. I've used Pydantic to validate the key in get_many() while still allowing None. |
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.