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 Tableau DAGs to new design #24125

Merged
merged 1 commit into from
Jun 3, 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/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)