Skip to content

Commit

Permalink
Remove system test for derepcated Google analytics operators
Browse files Browse the repository at this point in the history
The API is turned off and no longer works
  • Loading branch information
moiseenkov committed Sep 2, 2024
1 parent 9e40107 commit b86b4da
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 148 deletions.
11 changes: 0 additions & 11 deletions airflow/providers/google/marketing_platform/operators/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ class GoogleAnalyticsListAccountsOperator(BaseOperator):
and for python client
http://googleapis.github.io/google-api-python-client/docs/dyn/analytics_v3.management.accounts.html#list
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:GoogleAnalyticsListAccountsOperator`
:param api_version: The version of the api that will be requested for example 'v3'.
:param gcp_conn_id: The connection ID to use when fetching connection info.
:param impersonation_chain: Optional service account to impersonate using short-term
Expand Down Expand Up @@ -120,9 +116,6 @@ class GoogleAnalyticsGetAdsLinkOperator(BaseOperator):
Check official API docs:
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/webPropertyAdWordsLinks/get
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:GoogleAnalyticsGetAdsLinkOperator`
:param account_id: ID of the account which the given web property belongs to.
:param web_property_ad_words_link_id: Web property-Google Ads link ID.
Expand Down Expand Up @@ -199,10 +192,6 @@ class GoogleAnalyticsRetrieveAdsLinksListOperator(BaseOperator):
Check official API docs:
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/webPropertyAdWordsLinks/list#http-request
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:GoogleAnalyticsRetrieveAdsLinksListOperator`
:param account_id: ID of the account which the given web property belongs to.
:param web_property_id: Web property UA-string to retrieve the Google Ads links for.
:param impersonation_chain: Optional service account to impersonate using short-term
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,64 +23,31 @@ For more information about the Google Analytics 360 API check
`official documentation <https://developers.google.com/analytics/devguides/config/mgmt/v3>`__.

Please note that the Google Analytics 360 API is replaced by
`Google Analytics 4 <https://developers.google.com/analytics/devguides/config/admin/v1>`__ and
`will be turned down on July 1, 2024 <https://support.google.com/analytics/answer/11583528>`__.
`Google Analytics 4 <https://developers.google.com/analytics/devguides/config/admin/v1>`__ and is
`turned down on July 1, 2024 <https://support.google.com/analytics/answer/11583528>`__.
Thus consider using new :doc:`Google Analytics (GA4) Admin Operators </operators/marketing_platform/analytics_admin>`.

Prerequisite Tasks
^^^^^^^^^^^^^^^^^^

.. include:: /operators/_partials/prerequisite_tasks.rst

.. _howto/operator:GoogleAnalyticsListAccountsOperator:

List the Accounts
^^^^^^^^^^^^^^^^^

To list accounts from Analytics you can use the
:class:`~airflow.providers.google.marketing_platform.operators.analytics.GoogleAnalyticsListAccountsOperator`.

.. exampleinclude:: /../../tests/system/providers/google/marketing_platform/example_analytics.py
:language: python
:dedent: 4
:start-after: [START howto_marketing_platform_list_accounts_operator]
:end-before: [END howto_marketing_platform_list_accounts_operator]

You can use :ref:`Jinja templating <concepts:jinja-templating>` with
:template-fields:`airflow.providers.google.marketing_platform.operators.analytics.GoogleAnalyticsListAccountsOperator`

.. _howto/operator:GoogleAnalyticsGetAdsLinkOperator:

Get Ad Words Link
^^^^^^^^^^^^^^^^^

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:: /../../tests/system/providers/google/marketing_platform/example_analytics.py
:language: python
:dedent: 4
:start-after: [START howto_marketing_platform_get_ads_link_operator]
:end-before: [END howto_marketing_platform_get_ads_link_operator]

You can use :ref:`Jinja templating <concepts:jinja-templating>` with
:template-fields:`airflow.providers.google.marketing_platform.operators.analytics.GoogleAnalyticsGetAdsLinkOperator`

.. _howto/operator:GoogleAnalyticsRetrieveAdsLinksListOperator:

List Google Ads Links
^^^^^^^^^^^^^^^^^^^^^

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:: /../../tests/system/providers/google/marketing_platform/example_analytics.py
:language: python
:dedent: 4
:start-after: [START howto_marketing_platform_retrieve_ads_links_list_operator]
:end-before: [END howto_marketing_platform_retrieve_ads_links_list_operator]

You can use :ref:`Jinja templating <concepts:jinja-templating>` with
:template-fields:`airflow.providers.google.marketing_platform.operators.analytics.GoogleAnalyticsRetrieveAdsLinksListOperator`
1 change: 0 additions & 1 deletion tests/always/test_example_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_kueue.py",
"tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_resource.py",
"tests/system/providers/google/cloud/life_sciences/example_life_sciences.py",
"tests/system/providers/google/marketing_platform/example_analytics.py",
# Deprecated Operators/Hooks, which replaced by common.sql Operators/Hooks
)

Expand Down
101 changes: 0 additions & 101 deletions tests/system/providers/google/marketing_platform/example_analytics.py

This file was deleted.

0 comments on commit b86b4da

Please sign in to comment.