hussein-awala commented on code in PR #30406:
URL: https://github.com/apache/airflow/pull/30406#discussion_r1155327069
##########
airflow/operators/trigger_dagrun.py:
##########
@@ -211,13 +211,16 @@ def execute(self, context: Context):
return
@provide_session
- def execute_complete(self, context: Context, session: Session, **kwargs):
- parsed_execution_date = context["execution_date"]
+ def execute_complete(self, context: Context, session: Session, event:
tuple | None = None):
Review Comment:
You can use the return type of the method serialize:
```suggestion
def execute_complete(self, context: Context, session: Session, event:
tuple[str, dict[str, Any]] | None = None):
```
##########
airflow/operators/trigger_dagrun.py:
##########
@@ -211,13 +211,16 @@ def execute(self, context: Context):
return
@provide_session
- def execute_complete(self, context: Context, session: Session, **kwargs):
- parsed_execution_date = context["execution_date"]
+ def execute_complete(self, context: Context, session: Session, event:
tuple | None = None):
+ # This execution date is parsed from the return trigger event
+ provided_execution_date = event[1].get("execution_dates")[0] # type:
ignore
Review Comment:
You can use the return type of the method `TaskStateTrigger.serialize`:
```suggestion
def execute_complete(self, context: Context, session: Session, event:
tuple[str, dict[str, Any]] | None = None):
# This execution date is parsed from the return trigger event
provided_execution_date = event[1].get("execution_dates")[0]
```
--
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]