Skip to content

Commit

Permalink
Migrate Zendesk example DAGs to new design #22471 (#24129)
Browse files Browse the repository at this point in the history
  • Loading branch information
chethanuk authored Jun 3, 2022
1 parent f294a26 commit 1965bf0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
16 changes: 0 additions & 16 deletions airflow/providers/zendesk/example_dags/__init__.py

This file was deleted.

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

Python API <_api/airflow/providers/zendesk/index>
Example DAGs <https://github.com/apache/airflow/tree/main/airflow/providers/zendesk/example_dags>
Example DAGs <https://github.com/apache/airflow/tree/main/tests/system/providers/zendesk/example_zendesk_custom_get.py>
PyPI Repository <https://pypi.org/project/apache-airflow-providers-zendesk/>
Installing from sources <installing-providers-from-sources>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
# specific language governing permissions and limitations
# under the License.

import os
from datetime import datetime
from typing import Dict, List

from airflow import DAG
from airflow.decorators import task
from airflow.providers.zendesk.hooks.zendesk import ZendeskHook

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


@task
def fetch_organizations() -> List[Dict]:
Expand All @@ -33,9 +37,14 @@ def fetch_organizations() -> List[Dict]:


with DAG(
dag_id="zendesk_custom_get_dag",
dag_id=DAG_ID,
schedule_interval=None,
start_date=datetime(2021, 1, 1),
catchup=False,
) as dag:
fetch_organizations()

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 1965bf0

Please sign in to comment.