uranusjr commented on code in PR #55068:
URL: https://github.com/apache/airflow/pull/55068#discussion_r2986609464
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -658,6 +662,66 @@ def emit_metrics(self):
extra_tags={"hostname": self.job.hostname},
)
+ @provide_session
+ def create_workload(
+ self,
+ trigger: Trigger,
+ dag_bag: DBDagBag,
+ render_log_fname=log_filename_template_renderer(),
+ session: Session = NEW_SESSION,
+ ) -> workloads.RunTrigger | None:
Review Comment:
* This should probably be `_create_workload` since it’s only used in the
class internally (not sure if I missed something).
* `provide_session` is not needed. Pass in the session explicitly instead.
* Calling `log_filename_template_renderer()` eagerly may be an issue since
it depends on Airflow conf. Call it inside the function instead.
--
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]