Skip to content

Deferrable HttpSensor does not move to Triggerer when using response_check #47719

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

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

dabla
Copy link
Contributor

@dabla dabla commented Mar 13, 2025

Closes: #40209

DAG Code:
image

Task going to Deferrable mode:
image

Output of the task:
image


^ 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.

davidblain-infrabel and others added 3 commits March 13, 2025 11:59
# Conflicts:
#	providers/http/src/airflow/providers/http/sensors/http.py
#	providers/http/src/airflow/providers/http/triggers/http.py
@dabla
Copy link
Contributor Author

dabla commented Mar 13, 2025

@eladkal Still need to remove the pickling, probably the check should move so pickling won't be necessary anymore

@dabla dabla marked this pull request as draft March 13, 2025 14:23
@dabla dabla marked this pull request as ready for review April 15, 2025 11:40
@dabla dabla requested a review from eladkal April 16, 2025 09:32
@dabla
Copy link
Contributor Author

dabla commented Apr 23, 2025

I think this one is ready

yield TriggerEvent(
{
"status": "success",
"response": base64.standard_b64encode(pickle.dumps(response)).decode("ascii"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use something else than pickle? Pickle is inherently insecure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check, maybe use the DagBag and get code directly from the processed DAG file?
That's the trick I did to make the streamable XCom possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@potiuk

Maybe use same mechanism from PythonOperator? Maybe move that logic into common module (common-devel) so it an be reused accross providers (here standard and http)? WDYT?

_SERIALIZERS: dict[_SerializerTypeDef, Any] = {
    "pickle": lazy_object_proxy.Proxy(_load_pickle),
    "dill": lazy_object_proxy.Proxy(_load_dill),
    "cloudpickle": lazy_object_proxy.Proxy(_load_cloudpickle),
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rather use our own serialization - and only one mechanism if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deferrable HttpSensor does not move to Triggerer when using response_check
5 participants