Skip to content

Commit

Permalink
Migrate Presto example DAGs to new design apache#22459
Browse files Browse the repository at this point in the history
  • Loading branch information
chethanuk committed Jun 3, 2022
1 parent f294a26 commit 35d628b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
16 changes: 0 additions & 16 deletions airflow/providers/presto/example_dags/__init__.py

This file was deleted.

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This operator assumes that CSV does not have headers and the data is correspondi
pre-existing presto table. Optionally, you can provide schema as tuple/list of strings or as a path to a
JSON file in the same bucket as the CSV file.

.. exampleinclude:: /../../airflow/providers/presto/example_dags/example_gcs_to_presto.py
.. exampleinclude:: /../../tests/system/providers/presto/example_gcs_to_presto.py
:language: python
:dedent: 4
:start-after: [START gcs_csv_to_presto_table]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
BUCKET = os.environ.get("GCP_GCS_BUCKET", "test28397yeo")
PATH_TO_FILE = os.environ.get("GCP_PATH", "path/to/file")
PRESTO_TABLE = os.environ.get("PRESTO_TABLE", "test_table")
ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID")
DAG_ID = "example_gcs_to_presto"

with models.DAG(
dag_id="example_gcs_to_presto",
dag_id=DAG_ID,
schedule_interval='@once', # Override to match your needs
start_date=datetime(2022, 1, 1),
catchup=False,
Expand All @@ -44,3 +46,9 @@
presto_table=PRESTO_TABLE,
)
# [END gcs_csv_to_presto_table]


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 35d628b

Please sign in to comment.