Skip to content

Commit

Permalink
AIP-47 - Migrate apache pig DAGs to new design #22439 (#24212)
Browse files Browse the repository at this point in the history
  • Loading branch information
chethanuk authored Jun 5, 2022
1 parent a2bfc0e commit 0046f12
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 30 deletions.
17 changes: 0 additions & 17 deletions airflow/providers/apache/pig/example_dags/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/apache-airflow-providers-apache-pig/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/pig/example_dags>
Example DAGs <https://github.com/apache/airflow/tree/main/tests/system/providers/apache/pig>
PyPI Repository <https://pypi.org/project/apache-airflow-providers-apache-pig/>
Installing from sources <installing-providers-from-sources>

Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow-providers-apache-pig/operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Pig programs are amenable to substantial parallelization, which in turns enables

use the PigOperator to execute a pig script

.. exampleinclude:: /../../airflow/providers/apache/pig/example_dags/example_pig.py
.. exampleinclude:: /../../tests/system/providers/apache/pig/example_pig.py
:language: python
:start-after: [START create_pig]
:end-before: [END create_pig]
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,34 @@
# under the License.

"""Example DAG demonstrating the usage of the PigOperator."""

import os
from datetime import datetime

from airflow import DAG
from airflow.providers.apache.pig.operators.pig import PigOperator

dag = DAG(
ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID")
DAG_ID = "example_adf_run_pipeline"

with DAG(
dag_id='example_pig_operator',
schedule_interval=None,
start_date=datetime(2021, 1, 1),
catchup=False,
tags=['example'],
)

# [START create_pig]
run_this = PigOperator(
task_id="run_example_pig_script",
pig="ls /;",
pig_opts="-x local",
dag=dag,
)
# [END create_pig]
) as dag:

# [START create_pig]
run_this = PigOperator(
task_id="run_example_pig_script",
pig="ls /;",
pig_opts="-x local",
)
# [END create_pig]


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)

0 comments on commit 0046f12

Please sign in to comment.