Skip to content

Commit

Permalink
AIP-47 - Migrate Tableau DAGs to new design (#24125)
Browse files Browse the repository at this point in the history
  • Loading branch information
chethanuk committed Jun 3, 2022
1 parent 2f0ee38 commit 23f367a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
16 changes: 0 additions & 16 deletions airflow/providers/tableau/example_dags/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/apache-airflow-providers-tableau/operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Using the Operator

An example usage of the TableauOperator is as follows:

.. exampleinclude:: /../../airflow/providers/tableau/example_dags/example_tableau.py
.. exampleinclude:: /../../tests/system/providers/tableau/example_tableau.py
:language: python
:start-after: [START howto_operator_tableau]
:end-before: [END howto_operator_tableau]
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
waits until it succeeds. The second does not wait since this is an asynchronous operation and we don't know
when the operation actually finishes. That's why we have another task that checks only that.
"""
import os
from datetime import datetime, timedelta

from airflow import DAG
from airflow.providers.tableau.operators.tableau import TableauOperator
from airflow.providers.tableau.sensors.tableau import TableauJobStatusSensor

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

with DAG(
dag_id='example_tableau',
default_args={'site_id': 'my_site'},
Expand Down Expand Up @@ -62,3 +66,9 @@

# Task dependency created via XComArgs:
# task_refresh_workbook_non_blocking >> task_check_job_status


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)
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@
waits until it succeeds. The second does not wait since this is an asynchronous operation and we don't know
when the operation actually finishes. That's why we have another task that checks only that.
"""
import os
from datetime import datetime, timedelta

from airflow import DAG
from airflow.providers.tableau.operators.tableau import TableauOperator
from airflow.providers.tableau.sensors.tableau import TableauJobStatusSensor

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

with DAG(
dag_id='example_tableau_refresh_workbook',
dag_id=DAG_ID,
dagrun_timeout=timedelta(hours=2),
schedule_interval=None,
start_date=datetime(2021, 1, 1),
Expand Down Expand Up @@ -60,3 +64,9 @@

# Task dependency created via XComArgs:
# task_refresh_workbook_non_blocking >> task_check_job_status


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 23f367a

Please sign in to comment.