Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIP-47 - Migrate livy DAGs to new design #22439 #24208

Merged
merged 1 commit into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions airflow/providers/apache/livy/example_dags/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/apache-airflow-providers-apache-livy/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Content
:maxdepth: 1
:caption: Resources

Example DAGs <https://github.com/apache/airflow/tree/main/airflow/providers/apache/livy/example_dags>
Example DAGs <https://github.com/apache/airflow/tree/main/tests/system/providers/apache/livy>
PyPI Repository <https://pypi.org/project/apache-airflow-providers-apache-livy/>
Installing from sources <installing-providers-from-sources>

Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow-providers-apache-livy/operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LivyOperator

This operator wraps the Apache Livy batch REST API, allowing to submit a Spark application to the underlying cluster.

.. exampleinclude:: /../../airflow/providers/apache/livy/example_dags/example_livy.py
.. exampleinclude:: /../../tests/system/providers/apache/livy/example_livy.py
:language: python
:start-after: [START create_livy]
:end-before: [END create_livy]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@
The tasks below trigger the computation of pi on the Spark instance
using the Java and Python executables provided in the example library.
"""

import os
from datetime import datetime

from airflow import DAG
from airflow.providers.apache.livy.operators.livy import LivyOperator

ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID")
DAG_ID = "example_livy_operator"

with DAG(
dag_id='example_livy_operator',
dag_id=DAG_ID,
default_args={'args': [10]},
schedule_interval='@daily',
start_date=datetime(2021, 1, 1),
Expand All @@ -48,3 +53,14 @@

livy_java_task >> livy_python_task
# [END create_livy]

from tests.system.utils.watcher import watcher

# This test needs watcher in order to properly mark success/failure
# when "tearDown" task with trigger rule is part of the DAG
list(dag.tasks) >> watcher()

from tests.system.utils import get_test_run # noqa: E402

# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest)
test_run = get_test_run(dag)