Skip to content

Commit

Permalink
[AIRFLOW-5656] Rename provider to providers module (#6333)
Browse files Browse the repository at this point in the history
  • Loading branch information
turbaszek authored and potiuk committed Oct 18, 2019
1 parent 7bdc063 commit 19e32b4
Show file tree
Hide file tree
Showing 26 changed files with 67 additions and 67 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import os

from airflow import models
from airflow.provider.google.marketing_platform.operators.campaign_manager import (
from airflow.providers.google.marketing_platform.operators.campaign_manager import (
GoogleCampaignManagerDeleteReportOperator, GoogleCampaignManagerDownloadReportOperator,
GoogleCampaignManagerInsertReportOperator, GoogleCampaignManagerRunReportOperator,
)
from airflow.provider.google.marketing_platform.sensors.campaign_manager import (
from airflow.providers.google.marketing_platform.sensors.campaign_manager import (
GoogleCampaignManagerReportSensor,
)
from airflow.utils import dates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from airflow import AirflowException
from airflow.gcp.hooks.gcs import GoogleCloudStorageHook
from airflow.models.baseoperator import BaseOperator
from airflow.provider.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook
from airflow.providers.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook
from airflow.utils.decorators import apply_defaults


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"""
from typing import Dict, Optional

from airflow.provider.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook
from airflow.providers.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook
from airflow.sensors.base_sensor_operator import BaseSensorOperator
from airflow.utils.decorators import apply_defaults

Expand Down
6 changes: 3 additions & 3 deletions docs/autoapi_templates/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ All operators are in the following packages:

airflow/gcp/sensors/index

airflow/provider/google/marketing_platform/operators/index
airflow/providers/google/marketing_platform/operators/index

airflow/provider/google/marketing_platform/sensors/index
airflow/providers/google/marketing_platform/sensors/index


Hooks
Expand All @@ -98,7 +98,7 @@ All hooks are in the following packages:

airflow/gcp/hooks/index

airflow/provider/google/marketing_platform/hooks/index
airflow/providers/google/marketing_platform/hooks/index


Executors
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@
'_api/airflow/gcp/index.rst',
'_api/airflow/gcp/example_dags',
'_api/airflow/gcp/utils',
'_api/airflow/provider/index.rst',
'_api/airflow/provider/google/index.rst',
'_api/airflow/provider/google/marketing_platform/index.rst',
'_api/airflow/provider/google/marketing_platform/example_dags',
'_api/airflow/providers/index.rst',
'_api/airflow/providers/google/index.rst',
'_api/airflow/providers/google/marketing_platform/index.rst',
'_api/airflow/providers/google/marketing_platform/example_dags',
'autoapi_templates',
'howto/operator/gcp/_partials',
]
Expand Down
30 changes: 15 additions & 15 deletions docs/howto/operator/gcp/campaign_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,35 @@ Deleting a report
^^^^^^^^^^^^^^^^^

To delete Campaign Manager report you can use the
:class:`~airflow.provider.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDeleteReportOperator`.
:class:`~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDeleteReportOperator`.
It deletes a report by its unique ID.

.. exampleinclude:: ../../../../airflow/provider/google/marketing_platform/example_dags/example_campaign_manager.py
.. exampleinclude:: ../../../../airflow/providers/google/marketing_platform/example_dags/example_campaign_manager.py
:language: python
:dedent: 4
:start-after: [START howto_campaign_manager_delete_report_operator]
:end-before: [END howto_campaign_manager_delete_report_operator]

You can use :ref:`Jinja templating <jinja-templating>` with
:template-fields:`airflow.provider.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDeleteReportOperator`
:template-fields:`airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDeleteReportOperator`
parameters which allows you to dynamically determine values.

.. _howto/operator:GoogleCampaignManagerDownloadReportOperator:

Downloading a report
^^^^^^^^^^^^^^^^^^^^

The :class:`~airflow.provider.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDownloadReportOperator`.
The :class:`~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDownloadReportOperator`.
allows you to download a Campaign Manager to Google Cloud Storage bucket.

.. exampleinclude:: ../../../../airflow/provider/google/marketing_platform/example_dags/example_campaign_manager.py
.. exampleinclude:: ../../../../airflow/providers/google/marketing_platform/example_dags/example_campaign_manager.py
:language: python
:dedent: 4
:start-after: [START howto_campaign_manager_get_report_operator]
:end-before: [END howto_campaign_manager_get_report_operator]

You can use :ref:`Jinja templating <jinja-templating>` with
:template-fields:`airflow.provider.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDownloadReportOperator`
:template-fields:`airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDownloadReportOperator`
parameters which allows you to dynamically determine values.

.. _howto/operator:GoogleCampaignManagerReportSensor:
Expand All @@ -75,16 +75,16 @@ Waiting for a report
^^^^^^^^^^^^^^^^^^^^

Report are generated asynchronously. To wait for report to be ready for downloading
you can use :class:`~airflow.provider.google.marketing_platform.sensors.campaign_manager.GoogleCampaignManagerReportSensor`.
you can use :class:`~airflow.providers.google.marketing_platform.sensors.campaign_manager.GoogleCampaignManagerReportSensor`.

.. exampleinclude:: ../../../../airflow/provider/google/marketing_platform/example_dags/example_campaign_manager.py
.. exampleinclude:: ../../../../airflow/providers/google/marketing_platform/example_dags/example_campaign_manager.py
:language: python
:dedent: 4
:start-after: [START howto_campaign_manager_wait_for_operation]
:end-before: [END howto_campaign_manager_wait_for_operation]

You can use :ref:`Jinja templating <jinja-templating>` with
:template-fields:`airflow.provider.google.marketing_platform.sensors.campaign_manager.GoogleCampaignManagerReportSensor`
:template-fields:`airflow.providers.google.marketing_platform.sensors.campaign_manager.GoogleCampaignManagerReportSensor`
parameters which allows you to dynamically determine values.

.. _howto/operator:GoogleCampaignManagerInsertReportOperator:
Expand All @@ -93,17 +93,17 @@ Inserting a new report
^^^^^^^^^^^^^^^^^^^^^^

To insert a Campaign Manager report you can use the
:class:`~airflow.provider.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerInsertReportOperator`.
:class:`~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerInsertReportOperator`.
Running this operator creates a new report.

.. exampleinclude:: ../../../../airflow/provider/google/marketing_platform/example_dags/example_campaign_manager.py
.. exampleinclude:: ../../../../airflow/providers/google/marketing_platform/example_dags/example_campaign_manager.py
:language: python
:dedent: 4
:start-after: [START howto_campaign_manager_insert_report_operator]
:end-before: [END howto_campaign_manager_insert_report_operator]

You can use :ref:`Jinja templating <jinja-templating>` with
:template-fields:`airflow.provider.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerInsertReportOperator`
:template-fields:`airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerInsertReportOperator`
parameters which allows you to dynamically determine values.
The result is saved to :ref:`XCom <concepts:xcom>`, which allows it to be used by other operators.

Expand All @@ -113,15 +113,15 @@ Running a report
^^^^^^^^^^^^^^^^

To run Campaign Manager report you can use the
:class:`~airflow.provider.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerRunReportOperator`.
:class:`~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerRunReportOperator`.

.. exampleinclude:: ../../../../airflow/provider/google/marketing_platform/example_dags/example_campaign_manager.py
.. exampleinclude:: ../../../../airflow/providers/google/marketing_platform/example_dags/example_campaign_manager.py
:language: python
:dedent: 4
:start-after: [START howto_campaign_manager_run_report_operator]
:end-before: [END howto_campaign_manager_run_report_operator]

You can use :ref:`Jinja templating <jinja-templating>` with
:template-fields:`airflow.provider.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerRunReportOperator`
:template-fields:`airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerRunReportOperator`
parameters which allows you to dynamically determine values.
The result is saved to :ref:`XCom <concepts:xcom>`, which allows it to be used by other operators.
6 changes: 3 additions & 3 deletions docs/operators-and-hooks-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,9 @@ These integrations allow you to perform various operations within various servic

* - `Google Campaign Manager <https://developers.google.com/doubleclick-advertisers>`__
- :doc:`How to use <howto/operator/gcp/campaign_manager>`
- :mod:`airflow.provider.google.marketing_platform.hooks.campaign_manager`
- :mod:`airflow.provider.google.marketing_platform.operators.campaign_manager`
- :mod:`airflow.provider.google.marketing_platform.sensors.campaign_manager`
- :mod:`airflow.providers.google.marketing_platform.hooks.campaign_manager`
- :mod:`airflow.providers.google.marketing_platform.operators.campaign_manager`
- :mod:`airflow.providers.google.marketing_platform.sensors.campaign_manager`

* - `Google Drive <https://www.google.com/drive/>`__
-
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# under the License.
from unittest import TestCase, mock

from airflow.provider.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook
from airflow.providers.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook
from tests.gcp.utils.base_gcp_mock import mock_base_gcp_hook_default_project_id

API_VERSION = "v3.3"
Expand All @@ -36,11 +36,11 @@ def setUp(self):
)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook._authorize"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.build"
)
def test_gen_conn(self, mock_build, mock_authorize):
Expand All @@ -54,11 +54,11 @@ def test_gen_conn(self, mock_build, mock_authorize):
self.assertEqual(mock_build.return_value, result)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook.get_conn"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCloudBaseHook.__init__"
)
def test_delete_report(self, mock_base_hook, get_conn_mock):
Expand All @@ -79,11 +79,11 @@ def test_delete_report(self, mock_base_hook, get_conn_mock):
self.assertEqual(return_value, result)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook.get_conn"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCloudBaseHook.__init__"
)
def test_get_report(self, mock_base_hook, get_conn_mock):
Expand All @@ -106,11 +106,11 @@ def test_get_report(self, mock_base_hook, get_conn_mock):
self.assertEqual(return_value, result)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook.get_conn"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCloudBaseHook.__init__"
)
def test_get_report_file(self, mock_base_hook, get_conn_mock):
Expand All @@ -134,11 +134,11 @@ def test_get_report_file(self, mock_base_hook, get_conn_mock):
self.assertEqual(return_value, result)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook.get_conn"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCloudBaseHook.__init__"
)
def test_insert_report(self, mock_base_hook, get_conn_mock):
Expand All @@ -159,11 +159,11 @@ def test_insert_report(self, mock_base_hook, get_conn_mock):
self.assertEqual(return_value, result)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook.get_conn"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCloudBaseHook.__init__"
)
def test_list_reports(self, mock_base_hook, get_conn_mock):
Expand Down Expand Up @@ -206,11 +206,11 @@ def test_list_reports(self, mock_base_hook, get_conn_mock):
self.assertEqual(items * 4, result)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook.get_conn"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCloudBaseHook.__init__"
)
def test_patch_report(self, mock_base_hook, get_conn_mock):
Expand All @@ -234,11 +234,11 @@ def test_patch_report(self, mock_base_hook, get_conn_mock):
self.assertEqual(return_value, result)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook.get_conn"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCloudBaseHook.__init__"
)
def test_run_report(self, mock_base_hook, get_conn_mock):
Expand All @@ -262,11 +262,11 @@ def test_run_report(self, mock_base_hook, get_conn_mock):
self.assertEqual(return_value, result)

@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCampaignManagerHook.get_conn"
)
@mock.patch(
"airflow.provider.google.marketing_platform.hooks."
"airflow.providers.google.marketing_platform.hooks."
"campaign_manager.GoogleCloudBaseHook.__init__"
)
def test_update_report(self, mock_base_hook, get_conn_mock):
Expand Down

0 comments on commit 19e32b4

Please sign in to comment.