Re: [PR] bugfix(airflowctl): support primitive and datamodel in operation parameters and fix trigger DagRun [airflow]
bugraoz93 merged PR #54073: URL: https://github.com/apache/airflow/pull/54073 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] bugfix(airflowctl): support primitive and datamodel in operation parameters and fix trigger DagRun [airflow]
bugraoz93 commented on PR #54073: URL: https://github.com/apache/airflow/pull/54073#issuecomment-3161414242 Merging this if no one disagrees. I can follow up if any additional changes are needed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] bugfix(airflowctl): support primitive and datamodel in operation parameters and fix trigger DagRun [airflow]
bugraoz93 commented on code in PR #54073:
URL: https://github.com/apache/airflow/pull/54073#discussion_r2252598242
##
airflow-ctl/src/airflowctl/api/operations.py:
##
@@ -554,11 +554,10 @@ def trigger(
self, dag_id: str, trigger_dag_run: TriggerDAGRunPostBody
) -> DAGRunResponse | ServerResponseError:
"""Create a dag run."""
+if trigger_dag_run.conf is None:
+trigger_dag_run.conf = {}
Review Comment:
Updated as it can be `None` means factory will end up as `{}`, it worked in
Postman too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] bugfix(airflowctl): support primitive and datamodel in operation parameters and fix trigger DagRun [airflow]
bugraoz93 commented on code in PR #54073:
URL: https://github.com/apache/airflow/pull/54073#discussion_r2252575890
##
airflow-ctl/src/airflowctl/api/operations.py:
##
@@ -554,11 +554,10 @@ def trigger(
self, dag_id: str, trigger_dag_run: TriggerDAGRunPostBody
) -> DAGRunResponse | ServerResponseError:
"""Create a dag run."""
+if trigger_dag_run.conf is None:
+trigger_dag_run.conf = {}
Review Comment:
I double-checked and see that the underlying core methods allow empty
`conf`. Since dict is in the factory, I think allowing None will resolve as
`{}` in the route method
https://github.com/apache/airflow/blob/c2059b9394d021cf955cf8bae13da8c39965bd92/airflow-core/src/airflow/models/dag.py#L1511
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] bugfix(airflowctl): support primitive and datamodel in operation parameters and fix trigger DagRun [airflow]
bugraoz93 commented on code in PR #54073:
URL: https://github.com/apache/airflow/pull/54073#discussion_r2252555387
##
airflow-ctl/src/airflowctl/api/operations.py:
##
@@ -554,11 +554,10 @@ def trigger(
self, dag_id: str, trigger_dag_run: TriggerDAGRunPostBody
) -> DAGRunResponse | ServerResponseError:
"""Create a dag run."""
+if trigger_dag_run.conf is None:
+trigger_dag_run.conf = {}
Review Comment:
That would be a lot easier indeed. The datamodel has already `dict` as
default factory. It seems it needs to be fixed from the API. Because even I
sent from Postman as `null`, it is giving an error. Field already has a default
factory to dict. I am not sure why it is not working properly. I was thinking
of a follow-up, but I can include it in this as well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] bugfix(airflowctl): support primitive and datamodel in operation parameters and fix trigger DagRun [airflow]
bugraoz93 commented on code in PR #54073:
URL: https://github.com/apache/airflow/pull/54073#discussion_r2252555387
##
airflow-ctl/src/airflowctl/api/operations.py:
##
@@ -554,11 +554,10 @@ def trigger(
self, dag_id: str, trigger_dag_run: TriggerDAGRunPostBody
) -> DAGRunResponse | ServerResponseError:
"""Create a dag run."""
+if trigger_dag_run.conf is None:
+trigger_dag_run.conf = {}
Review Comment:
That would be a lot easier indeed. The datamodel has already `None` as
default. It seems it needs to be fixed from the API. Because even I sent from
Postman as `null`, it is giving an error. Field already has a default factory
to dict. I am not sure why it is not working properly. I was thinking of a
follow-up, but I can include it in this as well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] bugfix(airflowctl): support primitive and datamodel in operation parameters and fix trigger DagRun [airflow]
jscheffl commented on code in PR #54073:
URL: https://github.com/apache/airflow/pull/54073#discussion_r2250099228
##
airflow-ctl/src/airflowctl/api/operations.py:
##
@@ -554,11 +554,10 @@ def trigger(
self, dag_id: str, trigger_dag_run: TriggerDAGRunPostBody
) -> DAGRunResponse | ServerResponseError:
"""Create a dag run."""
+if trigger_dag_run.conf is None:
+trigger_dag_run.conf = {}
Review Comment:
Instead of this is it not easier to define `{}` as default in the
`TriggerDAGRunPostBody`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
