Skip to content

Commit

Permalink
AIP-47 | Migrate Trino example DAGs to new design (#24118)
Browse files Browse the repository at this point in the history
  • Loading branch information
chethanuk authored Jun 2, 2022
1 parent d0a295c commit 7489962
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
17 changes: 0 additions & 17 deletions airflow/providers/trino/example_dags/__init__.py

This file was deleted.

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/trino/example_dags/example_gcs_to_trino.py
.. exampleinclude:: /../../tests/system/providers/trino/example_gcs_to_trino.py
:language: python
:dedent: 4
:start-after: [START gcs_csv_to_trino_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")
TRINO_TABLE = os.environ.get("TRINO_TABLE", "test_table")
ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID")
DAG_ID = "example_gcs_to_trino"

with models.DAG(
dag_id="example_gcs_to_trino",
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 @@
trino_table=TRINO_TABLE,
)
# [END gcs_csv_to_trino_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 7489962

Please sign in to comment.