amoghrajesh commented on code in PR #50376:
URL: https://github.com/apache/airflow/pull/50376#discussion_r2083107941
##########
providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:
##########
@@ -444,6 +444,7 @@ class TaskInstanceInfo(InfoJsonEncodable):
includes = ["duration", "try_number", "pool", "queued_dttm", "log_url"]
casts = {
+ "log_url": lambda ti: ti.log_url if getattr(ti, "log_url", -1) != -1
else None,
Review Comment:
Why do we need this one?
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -158,6 +183,9 @@ def get_template_context(self) -> Context:
validated_params = process_params(self.task.dag, self.task,
dag_run_conf, suppress_exception=False)
+ self.log_url = self.get_log_url_from_ti()
+ self.mark_success_url = self.get_mark_success_url()
Review Comment:
Can we move this logic to "startup" instead? It doens't necessarily need to
have context in order to set these.
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -137,6 +137,10 @@ class RuntimeTaskInstance(TaskInstance):
rendered_map_index: str | None = None
+ log_url: str | None = None
+
+ mark_success_url: str | None = None
Review Comment:
Also i do not understand the use case/ motivation behind this one
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -137,6 +137,10 @@ class RuntimeTaskInstance(TaskInstance):
rendered_map_index: str | None = None
+ log_url: str | None = None
+
+ mark_success_url: str | None = None
Review Comment:
Let's please extract this one to a separate PR.
##########
task-sdk/tests/task_sdk/execution_time/test_task_runner.py:
##########
@@ -1028,6 +1028,8 @@ def test_get_context_without_ti_context_from_server(self,
mocked_parse, make_ti_
_ti_context_from_server=None,
start_date=start_date,
)
+ runtime_ti.log_url = runtime_ti.get_log_url_from_ti()
Review Comment:
Can we add a test that gets that asserts the log_url?
--
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]