-
Notifications
You must be signed in to change notification settings - Fork 16.4k
fix(XCom): /xcom/list got exception when applying filter on the value column #46053
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
fix(XCom): /xcom/list got exception when applying filter on the value column #46053
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)
|
|
AI spam |
|
Hi @eladkal |
|
Hi @eladkal, sorry to bother you. I’m trying to have @wei-juncheng take over the testing part for #45679 as his first contribution to Airflow. Since he’s new to OSS contributions, his profile doesn’t have many contribution records yet. @wei-juncheng could you help add more information about what the PR has made and also correct the status to Draft if it is not ready, I'll also close my original PR to avoid confusion, thanks! |
|
Hi @eladkal, Thank you for working on filtering potential AI spam. 😊 I wanted to give you a quick heads-up. I know @josix personally, and he has already created a few pull requests (PRs) and even presented them at the Airflow Town Hall. Additionally, @wei-juncheng is a local community member from Taiwan who is interested in contributing to Airflow and has just started his journey in OSS contributions. I've asked @wei-juncheng to create another PR with more details so he can continue working on this issue and avoid making his PR look like spam. Sorry for the disruption. 🙏 |
|
Ah cool :) |
ah... yes, we can just reopen it haha. Thanks so much for helping out! |
416ef22 to
5c6bc71
Compare
5c6bc71 to
2fab1b6
Compare
Lee-W
left a comment
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.
It mostly looks good to me, but I have some nitpicks. I propose a new way to implement the utility function; however, I'm not sure if it actually simplifies things. If it doesn't, we can just resolve those f-strings once.
2fab1b6 to
88e855d
Compare
reduce code duplication and add type annotation fix fix fix
88e855d to
d97f25b
Compare
d97f25b to
e9f7079
Compare
Lee-W
left a comment
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.
LGTM. will keep it for a few days so that others can take a look
e9f7079 to
3d6c522
Compare
use @pytest.mark.parametrize test all kind of XComFilter fix unit test parametrize
3d6c522 to
ff3e8aa
Compare
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
closes: #42720
What does this PR do?
Change details
airflow/www/utils.py:Add
XComFilterStartsWith,XComFilterEndsWith,XComFilterEqual,XComFilterContains,XComFilterNotStartsWith,XComFilterNotEndsWith,XComFilterNotContains, andXComFilterNotEqualclasses to handle different types of filtering for XCom values.valueis stored in thexcomtable in PostgreSQL'sbyteaformat, we first need to convert it into a UTF-8 string. Additionally, because the value content is enclosed in double quotes before being encoded asbyteaand stored in the database, we also need to remove the leading and trailing double quotes from the UTF-8 formatted value in order to compare it with the user's input filter condition.xcomtable:Updated the
AirflowFilterConverterclass to include the new XCom filters in its conversion table.Add the
is_xcom_valuemethod to check if a column name corresponds to an XCom value.tests/www/test_utils.py:TestXComFilterto test whether the SQLAlchemy call sequence behaves as expected.How did you test?
tests/www/test_utils.pyI used the example code provided by Airflow to push the XCom content to the database during DAG execution, and then I operated the XCom filter on the Web UI.
Below are the demo screenshots for each of the functionalities.
Demo screenshots:
Starts With:
Ends With:
Equal:
Contains:
Not Starts With:
Not Ends With:
Not Contains With:
Not Equal:
^ 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.rstor{issue_number}.significant.rst, in newsfragments.