Skip to content

Commit 42b9faa

Browse files
committed
[DOP-22735] All Spark urls should be singular
1 parent 90152eb commit 42b9faa

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

data_rentgen/consumer/extractors/run.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,19 @@ def enrich_run_identifiers(run: RunDTO, event: OpenLineageRunEvent) -> RunDTO:
8484
return run
8585

8686

87-
def enrich_run_logs(run: RunDTO, event: OpenLineageRunEvent) -> RunDTO:
87+
def enrich_run_logs(run: RunDTO, event: OpenLineageRunEvent) -> RunDTO: # noqa: WPS231
8888
spark_application_details = event.run.facets.spark_applicationDetails
8989
if spark_application_details:
9090
if spark_application_details.proxyUrl:
91-
run.running_log_url = spark_application_details.proxyUrl.split(",")[0]
91+
run.running_log_url = spark_application_details.proxyUrl
9292
else:
9393
run.running_log_url = spark_application_details.uiWebUrl
9494
run.persistent_log_url = spark_application_details.historyUrl
95+
96+
if run.running_log_url:
97+
run.running_log_url = run.running_log_url.split(",")[0]
98+
if run.persistent_log_url:
99+
run.persistent_log_url = run.persistent_log_url.split(",")[0]
95100
return run
96101

97102
airflow_dag_run_facet = event.run.facets.airflowDagRun

tests/test_consumer/test_extractors/test_extractors_run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def test_extractors_extract_run_spark_app_yarn():
7272
driverHost="localhost",
7373
userName="myuser",
7474
uiWebUrl="http://localhost:4040",
75-
proxyUrl="http://yarn-proxy:8088/proxy/application_1234_5678,http://yarn-proxy:8088/proxy/application_8765_4321",
76-
historyUrl="http://history-server:18081/history/application_1234_5678/",
75+
proxyUrl="http://yarn-proxy:8088/proxy/application_1234_5678,http://yarn-proxy:18088/proxy/application_1234_5678",
76+
historyUrl="http://history-server:18080/history/application_1234_5678,http://history-server:18081/history/application_1234_5678",
7777
),
7878
),
7979
),
@@ -92,7 +92,7 @@ def test_extractors_extract_run_spark_app_yarn():
9292
ended_at=None,
9393
external_id="application_1234_5678",
9494
attempt=None,
95-
persistent_log_url="http://history-server:18081/history/application_1234_5678/",
95+
persistent_log_url="http://history-server:18080/history/application_1234_5678",
9696
running_log_url="http://yarn-proxy:8088/proxy/application_1234_5678",
9797
)
9898

@@ -124,7 +124,7 @@ def test_extractors_extract_run_spark_app_local():
124124
deployMode=OpenLineageSparkDeployMode.CLIENT,
125125
driverHost="localhost",
126126
userName="myuser",
127-
uiWebUrl="http://localhost:4040",
127+
uiWebUrl="http://localhost:4040,http://localhost:4041",
128128
),
129129
),
130130
),

0 commit comments

Comments
 (0)