Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ List the Accounts
To list accounts from Analytics you can use the
:class:`~airflow.providers.google.marketing_platform.operators.analytics.GoogleAnalyticsListAccountsOperator`.

.. exampleinclude:: /../../airflow/providers/google/marketing_platform/example_dags/example_analytics.py
.. exampleinclude:: /../../tests/system/providers/google/marketing_platform/example_analytics.py
:language: python
:dedent: 4
:start-after: [START howto_marketing_platform_list_accounts_operator]
Expand All @@ -53,7 +53,7 @@ Returns a web property-Google Ads link to which the user has access.
To list web property-Google Ads link you can use the
:class:`~airflow.providers.google.marketing_platform.operators.analytics.GoogleAnalyticsGetAdsLinkOperator`.

.. exampleinclude:: /../../airflow/providers/google/marketing_platform/example_dags/example_analytics.py
.. exampleinclude:: /../../tests/system/providers/google/marketing_platform/example_analytics.py
:language: python
:dedent: 4
:start-after: [START howto_marketing_platform_get_ads_link_operator]
Expand All @@ -71,7 +71,7 @@ Operator returns a list of entity Google Ads links.
To list Google Ads links you can use the
:class:`~airflow.providers.google.marketing_platform.operators.analytics.GoogleAnalyticsRetrieveAdsLinksListOperator`.

.. exampleinclude:: /../../airflow/providers/google/marketing_platform/example_dags/example_analytics.py
.. exampleinclude:: /../../tests/system/providers/google/marketing_platform/example_analytics.py
:language: python
:dedent: 4
:start-after: [START howto_marketing_platform_retrieve_ads_links_list_operator]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
GoogleAnalyticsRetrieveAdsLinksListOperator,
)

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

ACCOUNT_ID = os.environ.get("GA_ACCOUNT_ID", "123456789")

BUCKET = os.environ.get("GMP_ANALYTICS_BUCKET", "test-airflow-analytics-bucket")
Expand All @@ -39,10 +42,11 @@
DATA_ID = "kjdDu3_tQa6n8Q1kXFtSmg"

with models.DAG(
"example_google_analytics",
DAG_ID,
schedule_interval='@once', # Override to match your needs,
start_date=datetime(2021, 1, 1),
catchup=False,
tags=["example", "analytics"],
) as dag:
# [START howto_marketing_platform_list_accounts_operator]
list_account = GoogleAnalyticsListAccountsOperator(task_id="list_account")
Expand Down Expand Up @@ -86,3 +90,9 @@
)

upload >> [delete, transform]


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)