Skip to content

Commit 2c3f9e5

Browse files
authored
Do not dynamically add dag_doc.md when parsing the test (#59933)
* Do not dynamically add dag_doc.md when parsing the test The file should not be dynamically generated, as it is expected, it should be just added to the repo. * Apply suggestion from @potiuk
1 parent b3667fc commit 2c3f9e5

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
# MD doc file

providers/openlineage/tests/system/openlineage/example_openlineage_docs_file_dag.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
from __future__ import annotations
2525

26-
import os
2726
from datetime import datetime
2827

2928
from airflow import DAG
@@ -32,20 +31,14 @@
3231
from system.openlineage.expected_events import get_expected_event_file_path
3332
from system.openlineage.operator import OpenLineageTestOperator
3433

35-
# Create file at DAG parsing to make sure it's in the right place
36-
_FILE_PATH = "dag_doc.md"
37-
if not os.path.exists(_FILE_PATH):
38-
with open(_FILE_PATH, "w") as f:
39-
f.write("# MD doc file")
40-
4134
DAG_ID = "openlineage_docs_file_dag"
4235

4336
with DAG(
4437
dag_id=DAG_ID,
4538
start_date=datetime(2021, 1, 1),
4639
schedule=None,
4740
catchup=False,
48-
doc_md=_FILE_PATH,
41+
doc_md="dag_doc.md",
4942
default_args={"retries": 0},
5043
) as dag:
5144
do_nothing_task = BashOperator(task_id="do_nothing_task", bash_command="sleep 1;")

0 commit comments

Comments
 (0)