Skip to content

Commit cc29e02

Browse files
authored
Move example_dags in standard provider to example_dags in sources (apache#51260)
Folow up after apache#51192. Actually choosing the same approach as for system tests was pretty wrong and even before attempting to have final solution for example_dags/system tests we should move the standard examples out of "tests.system" as rightfully pointed out by Jed in the apache#51192. The snippets of code to run the tests as pytests are not neeeded and they are actually even harmful as they cause import errors when no tests_common is around
1 parent c88bf69 commit cc29e02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+72
-198
lines changed

airflow-core/docs/tutorial/taskflow.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ system-level packages. TaskFlow supports multiple execution environments to isol
270270
Creates a temporary virtualenv at task runtime. Great for experimental or dynamic tasks, but may have cold start
271271
overhead.
272272

273-
.. exampleinclude:: /../../providers/standard/tests/system/standard/example_python_decorator.py
273+
.. exampleinclude:: /../../providers/standard/src/airflow/providers/standard/example_dags//example_python_decorator.py
274274
:language: python
275275
:dedent: 4
276276
:start-after: [START howto_operator_python_venv]
@@ -284,7 +284,7 @@ overhead.
284284

285285
Executes the task using a pre-installed Python interpreter — ideal for consistent environments or shared virtualenvs.
286286

287-
.. exampleinclude:: /../../providers/standard/tests/system/standard/example_python_decorator.py
287+
.. exampleinclude:: /../../providers/standard/src/airflow/providers/standard/example_dags//example_python_decorator.py
288288
:language: python
289289
:dedent: 4
290290
:start-after: [START howto_operator_external_python]
@@ -334,7 +334,7 @@ Using Sensors
334334
Use ``@task.sensor`` to build lightweight, reusable sensors using Python functions. These support both poke and reschedule
335335
modes.
336336

337-
.. exampleinclude:: /../../providers/standard/tests/system/standard/example_sensor_decorator.py
337+
.. exampleinclude:: /../../providers/standard/src/airflow/providers/standard/example_dags//example_sensor_decorator.py
338338
:language: python
339339
:start-after: [START tutorial]
340340
:end-before: [END tutorial]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../providers/standard/tests/system/standard/
1+
../../../../providers/standard/src/airflow/providers/standard/example_dags

airflow-core/tests/unit/jobs/test_scheduler_job.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,16 @@
101101
ELASTIC_DAG_FILE = os.path.join(PERF_DAGS_FOLDER, "elastic_dag.py")
102102

103103
TEST_DAG_FOLDER = os.environ["AIRFLOW__CORE__DAGS_FOLDER"]
104-
EXAMPLE_STANDARD_DAGS_FOLDER = AIRFLOW_ROOT_PATH / "providers" / "standard" / "tests" / "system" / "standard"
104+
EXAMPLE_STANDARD_DAGS_FOLDER = (
105+
AIRFLOW_ROOT_PATH
106+
/ "providers"
107+
/ "standard"
108+
/ "src"
109+
/ "airflow"
110+
/ "providers"
111+
/ "standard"
112+
/ "example_dags"
113+
)
105114
DEFAULT_DATE = timezone.datetime(2016, 1, 1)
106115
DEFAULT_LOGICAL_DATE = timezone.coerce_datetime(DEFAULT_DATE)
107116
TRY_NUMBER = 1

devel-common/src/docs/provider_conf.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
get_html_theme_options,
6262
get_intersphinx_mapping,
6363
get_rst_epilogue,
64-
get_rst_filepath_from_path,
6564
)
6665
from sphinx_exts.provider_yaml_utils import load_package_data
6766

@@ -162,10 +161,10 @@
162161
*[f"_api/tests/system/{subpackage}/index.rst" for subpackage in empty_subpackages],
163162
]
164163

165-
exclude_patterns.extend(
166-
get_rst_filepath_from_path(f, AIRFLOW_REPO_ROOT_PATH)
167-
for f in BASE_PROVIDER_SRC_PATH.rglob("example_dags")
168-
)
164+
# exclude_patterns.extend(
165+
# get_rst_filepath_from_path(f, AIRFLOW_REPO_ROOT_PATH)
166+
# for f in BASE_PROVIDER_SRC_PATH.rglob("example_dags")
167+
# )
169168

170169
# Add any paths that contain templates here, relative to this directory.
171170
templates_path = ["templates"]
@@ -297,7 +296,6 @@
297296
(
298297
"*/airflow/__init__.py",
299298
"*/airflow/providers/__init__.py",
300-
"*/example_dags/*",
301299
"*/providers/__init__.py",
302300
"*/conf/*",
303301
)

docs/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,7 @@ pluggable
13151315
pluggy
13161316
plyvel
13171317
png
1318+
PoC
13181319
PodManager
13191320
podName
13201321
PodSpec

providers/arangodb/docs/index.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@
4949
:maxdepth: 1
5050
:caption: Resources
5151

52-
Example DAGs <https://github.com/apache/airflow/tree/providers-arangodb/|version|/airflow/providers/arangodb/example_dags>
53-
54-
.. toctree::
55-
:hidden:
56-
:maxdepth: 1
57-
:caption: Resources
58-
52+
Example DAGs <_api/airflow/providers/arangodb/example_dags/index>
5953
PyPI Repository <https://pypi.org/project/apache-airflow-providers-arangodb/>
6054
Installing from sources <installing-providers-from-sources>
6155

providers/edge3/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
:maxdepth: 1
5858
:caption: Resources
5959

60-
Example DAGs <https://github.com/apache/airflow/tree/providers-edge3/|version|/providers/edge3/src/airflow/providers/edge3/example_dags>
60+
Example DAGs <_api/airflow/providers/edge3/example_dags/index>
6161
PyPI Repository <https://pypi.org/project/apache-airflow-providers-edge3/>
6262
Installing from sources <installing-providers-from-sources>
6363

providers/edge3/src/airflow/providers/edge3/example_dags/win_notepad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242

4343
class NotepadOperator(BaseOperator):
44-
"""Example Operator Implementation which starts a Notepod.exe on WIndows."""
44+
"""Example Operator Implementation which starts a ``Notepad.exe`` on Windows."""
4545

4646
template_fields: Sequence[str] = "text"
4747

providers/oracle/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
:maxdepth: 1
5757
:caption: Resources
5858

59-
Example DAGs <https://github.com/apache/airflow/tree/providers-oracle/|version|/airflow/providers/oracle/example_dags>
59+
Example DAGs <_api/airflow/providers/oracle/example_dags/index>
6060
PyPI Repository <https://pypi.org/project/apache-airflow-providers-oracle/>
6161
Installing from sources <installing-providers-from-sources>
6262

providers/standard/docs/index.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,12 @@
3838
Sensors <sensors/index>
3939
Configuration <configurations-ref>
4040

41-
.. toctree::
42-
:hidden:
43-
:maxdepth: 1
44-
:caption: System tests
45-
46-
System Tests <_api/tests/system/standard/index>
47-
4841
.. toctree::
4942
:hidden:
5043
:maxdepth: 1
5144
:caption: Resources
5245

53-
Example DAGs <https://github.com/apache/airflow/tree/providers-standard/|version|/providers/standard/tests/system/standard>
46+
Example DAGs <_api/airflow/providers/standard/example_dags/index>
5447
PyPI Repository <https://pypi.org/project/apache-airflow-providers-standard/>
5548
Installing from sources <installing-providers-from-sources>
5649
Python API <_api/airflow/providers/standard/index>

0 commit comments

Comments
 (0)