Skip to content

Commit

Permalink
[AIRFLOW-6682] Move GCP classes to providers package (#7295)
Browse files Browse the repository at this point in the history
* [AIP-21] Move gcp.hooks.automl providers.google.cloud.hooks.automl

* [AIP-21] Move gcp.hooks.bigquery providers.google.cloud.hooks.bigquery

* [AIP-21] Move gcp.hooks.bigquery_dts providers.google.cloud.hooks.bigquery_dts

* [AIP-21] Move gcp.hooks.bigtable providers.google.cloud.hooks.bigtable

* [AIP-21] Move gcp.hooks.cloud_build providers.google.cloud.hooks.cloud_build

* [AIP-21] Move gcp.hooks.cloud_memorystore providers.google.cloud.hooks.cloud_memorystore

* [AIP-21] Move gcp.hooks.cloud_sql providers.google.cloud.hooks.cloud_sql

* [AIP-21] Move gcp.hooks.cloud_storage_transfer_service providers.google.cloud.hooks.cloud_storage_transfer_service

* [AIP-21] Move gcp.hooks.compute providers.google.cloud.hooks.compute

* [AIP-21] Move gcp.hooks.dataflow providers.google.cloud.hooks.dataflow

* [AIP-21] Move gcp.hooks.datastore providers.google.cloud.hooks.datastore

* [AIP-21] Move gcp.hooks.dlp providers.google.cloud.hooks.dlp

* [AIP-21] Move gcp.hooks.functions providers.google.cloud.hooks.functions

* [AIP-21] Move gcp.hooks.gcs providers.google.cloud.hooks.gcs

* [AIP-21] Move gcp.hooks.kms providers.google.cloud.hooks.kms

* [AIP-21] Move gcp.hooks.kubernetes_engine providers.google.cloud.hooks.kubernetes_engine

* [AIP-21] Move gcp.hooks.mlengine providers.google.cloud.hooks.mlengine

* [AIP-21] Move gcp.hooks.spanner providers.google.cloud.hooks.spanner

* [AIP-21] Move gcp.hooks.speech_to_text providers.google.cloud.hooks.speech_to_text

* [AIP-21] Move gcp.hooks.text_to_speech providers.google.cloud.hooks.text_to_speech

* [AIP-21] Move gcp.hooks.translate providers.google.cloud.hooks.translate

* [AIP-21] Move gcp.hooks.discovery_api providers.google.cloud.hooks.discovery_api

* [AIP-21] Move gcp.hooks.video_intelligence providers.google.cloud.hooks.video_intelligence

* [AIP-21] Move gcp.sensors.bigquery providers.google.cloud.sensors.bigquery

* [AIP-21] Move gcp.sensors.bigquery_dts providers.google.cloud.sensors.bigquery_dts

* [AIP-21] Move gcp.sensors.bigtable providers.google.cloud.sensors.bigtable

* [AIP-21] Move gcp.sensors.cloud_storage_transfer_service providers.google.cloud.sensors.cloud_storage_transfer_service

* [AIP-21] Move gcp.operators.automl providers.google.cloud.operators.automl

* [AIP-21] Move gcp.operators.bigquery providers.google.cloud.operators.bigquery

* [AIP-21] Move gcp.operators.bigquery_dts providers.google.cloud.operators.bigquery_dts

* [AIP-21] Move gcp.operators.bigtable providers.google.cloud.operators.bigtable

* [AIP-21] Move gcp.operators.cloud_build providers.google.cloud.operators.cloud_build

* [AIP-21] Move gcp.operators.cloud_memorystore providers.google.cloud.operators.cloud_memorystore

* [AIP-21] Move gcp.operators.cloud_sql providers.google.cloud.operators.cloud_sql

* [AIP-21] Move gcp.operators.cloud_storage_transfer_service providers.google.cloud.operators.cloud_storage_transfer_service

* [AIP-21] Move gcp.operators.compute providers.google.cloud.operators.compute

* [AIP-21] Move gcp.operators.datastore providers.google.cloud.operators.datastore

* [AIP-21] Move gcp.operators.dlp providers.google.cloud.operators.dlp

* [AIP-21] Move gcp.operators.functions providers.google.cloud.operators.functions

* [AIP-21] Move gcp.operators.gcs providers.google.cloud.operators.gcs

* [AIP-21] Move gcp.operators.kubernetes_engine providers.google.cloud.operators.kubernetes_engine

* [AIP-21] Move gcp.operators.mlengine providers.google.cloud.operators.mlengine

* [AIP-21] Move gcp.operators.spanner providers.google.cloud.operators.spanner

* [AIP-21] Move gcp.operators.speech_to_text providers.google.cloud.operators.speech_to_text

* [AIP-21] Move gcp.operators.tasks providers.google.cloud.operators.tasks

* [AIP-21] Move gcp.operators.text_to_speech providers.google.cloud.operators.text_to_speech

* [AIP-21] Move gcp.operators.translate providers.google.cloud.operators.translate

* [AIP-21] Move gcp.operators.translate_speech providers.google.cloud.operators.translate_speech

* [AIP-21] Move gcp.operators.video_intelligence providers.google.cloud.operators.video_intelligence

* [AIP-21] Move operators.adls_to_gcs providers.google.cloud.operators.adls_to_gcs

* [AIP-21] Move operators.bigquery_to_bigquery providers.google.cloud.operators.bigquery_to_bigquery

* [AIP-21] Move operators.bigquery_to_gcs providers.google.cloud.operators.bigquery_to_gcs

* [AIP-21] Move operators.bigquery_to_mysql providers.google.cloud.operators.bigquery_to_mysql

* [AIP-21] Move operators.cassandra_to_gcs providers.google.cloud.operators.cassandra_to_gcs

* [AIP-21] Move operators.gcs_to_bq providers.google.cloud.operators.gcs_to_bigquery

* [AIP-21] Move operators.gcs_to_gcs providers.google.cloud.operators.gcs_to_gcs

* [AIP-21] Move operators.gcs_to_sftp providers.google.cloud.operators.gcs_to_sftp

* [AIP-21] Move operators.local_to_gcs providers.google.cloud.operators.local_to_gcs

* [AIP-21] Move operators.mssql_to_gcs providers.google.cloud.operators.mssql_to_gcs

* [AIP-21] Move operators.mysql_to_gcs providers.google.cloud.operators.mysql_to_gcs

* [AIP-21] Move operators.postgres_to_gcs providers.google.cloud.operators.postgres_to_gcs

* [AIP-21] Move operators.sql_to_gcs providers.google.cloud.operators.sql_to_gcs

* Update docs

* [AIP-21] Move gcp.hooks.base providers.google.cloud.hooks.base

* Move system tests to providers package

* Fix deprecation message

* Remove gcp.{operators,hooks,sensors}

* Move gcp.example_dags to providers.google.cloud.example_dags

* Move gcp.utils to providers.google.cloud.utils

* Remove airflow.gcp

* Fix import paths in tests

* Remove reference to airflow.gcp

* Fix utils path in test_mlengine_utils.py
  • Loading branch information
mik-laj committed Jan 30, 2020
1 parent 83c0378 commit 373c6aa
Show file tree
Hide file tree
Showing 372 changed files with 3,727 additions and 3,315 deletions.
406 changes: 203 additions & 203 deletions UPDATING.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions airflow/contrib/hooks/bigquery_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.bigquery`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.bigquery`."""

import warnings

# pylint: disable=unused-import
from airflow.gcp.hooks.bigquery import ( # noqa
from airflow.providers.google.cloud.hooks.bigquery import ( # noqa
BigQueryBaseCursor, BigQueryConnection, BigQueryCursor, BigQueryHook, BigQueryPandasConnector,
GbqConnector,
)

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.bigquery`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.bigquery`.",
DeprecationWarning, stacklevel=2
)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/datastore_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.datastore`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.datastore`."""

import warnings

# pylint: disable=unused-import
from airflow.gcp.hooks.datastore import DatastoreHook # noqa
from airflow.providers.google.cloud.hooks.datastore import DatastoreHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.datastore`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.datastore`.",
DeprecationWarning, stacklevel=2
)
10 changes: 5 additions & 5 deletions airflow/contrib/hooks/gcp_api_base_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.base`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.base`."""
import warnings

from airflow.gcp.hooks.base import CloudBaseHook
from airflow.providers.google.cloud.hooks.base import CloudBaseHook

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.base`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.base`.",
DeprecationWarning, stacklevel=2
)


class GoogleCloudBaseHook(CloudBaseHook):
"""
This class is deprecated. Please use `airflow.gcp.hooks.base.CloudBaseHook`.
This class is deprecated. Please use `airflow.providers.google.cloud.hooks.base.CloudBaseHook`.
"""
def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. Please use `airflow.gcp.hooks.base.CloudBaseHook`.",
"This class is deprecated. Please use `airflow.providers.google.cloud.hooks.base.CloudBaseHook`.",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/gcp_bigtable_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.bigtable`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.bigtable`."""

import warnings

# pylint: disable=unused-import
from airflow.gcp.hooks.bigtable import BigtableHook # noqa
from airflow.providers.google.cloud.hooks.bigtable import BigtableHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.bigtable`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.bigtable`.",
DeprecationWarning, stacklevel=2
)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/gcp_cloud_build_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.cloud_build`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.cloud_build`."""

import warnings

# pylint: disable=unused-import
from airflow.gcp.hooks.cloud_build import CloudBuildHook # noqa
from airflow.providers.google.cloud.hooks.cloud_build import CloudBuildHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.cloud_build`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.cloud_build`.",
DeprecationWarning, stacklevel=2
)
10 changes: 5 additions & 5 deletions airflow/contrib/hooks/gcp_compute_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.compute`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.compute`."""

import warnings

from airflow.gcp.hooks.compute import ComputeEngineHook
from airflow.providers.google.cloud.hooks.compute import ComputeEngineHook

warnings.warn(
"This module is deprecated. Please use airflow.gcp.hooks.compute`",
"This module is deprecated. Please use airflow.providers.google.cloud.hooks.compute`",
DeprecationWarning, stacklevel=2
)


class GceHook(ComputeEngineHook):
"""
This class is deprecated.
Please use ``airflow.gcp.hooks.compute.ComputeEngineHook``.
Please use ``airflow.providers.google.cloud.hooks.compute.ComputeEngineHook``.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. Please use `airflow.gcp.hooks.compute`.",
"This class is deprecated. Please use `airflow.providers.google.cloud.hooks.compute`.",
DeprecationWarning, stacklevel=2
)

Expand Down
10 changes: 5 additions & 5 deletions airflow/contrib/hooks/gcp_container_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.kubernetes_engine`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.kubernetes_engine`."""

import warnings

from airflow.gcp.hooks.kubernetes_engine import GKEHook
from airflow.providers.google.cloud.hooks.kubernetes_engine import GKEHook

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.kubernetes_engine`",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.kubernetes_engine`",
DeprecationWarning, stacklevel=2
)


class GKEClusterHook(GKEHook):
"""
This class is deprecated. Please use `airflow.gcp.hooks.container.GKEHook`.
This class is deprecated. Please use `airflow.providers.google.cloud.hooks.container.GKEHook`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. Please use `airflow.gcp.hooks.container.GKEHook`.",
"This class is deprecated. Please use `airflow.providers.google.cloud.hooks.container.GKEHook`.",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)
11 changes: 6 additions & 5 deletions airflow/contrib/hooks/gcp_dataflow_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,26 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.dataflow`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.dataflow`."""

import warnings

from airflow.gcp.hooks.dataflow import DataflowHook
from airflow.providers.google.cloud.hooks.dataflow import DataflowHook

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.dataflow`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.dataflow`.",
DeprecationWarning, stacklevel=2
)


class DataFlowHook(DataflowHook):
"""
This class is deprecated. Please use `airflow.gcp.hooks.dataflow.DataflowHook`.
This class is deprecated. Please use `airflow.providers.google.cloud.hooks.dataflow.DataflowHook`.
"""
def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. Please use `airflow.gcp.hooks.dataflow.DataflowHook`.",
"This class is deprecated. "
"Please use `airflow.providers.google.cloud.hooks.dataflow.DataflowHook`.",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/gcp_dlp_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.dlp`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.dlp`."""

import warnings

# pylint: disable=unused-import
from airflow.gcp.hooks.dlp import CloudDLPHook, DlpJob # noqa
from airflow.providers.google.cloud.hooks.dlp import CloudDLPHook, DlpJob # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.dlp`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.dlp`.",
DeprecationWarning, stacklevel=2
)
11 changes: 6 additions & 5 deletions airflow/contrib/hooks/gcp_function_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,27 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.functions`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.functions`."""

import warnings

from airflow.gcp.hooks.functions import CloudFunctionsHook
from airflow.providers.google.cloud.hooks.functions import CloudFunctionsHook

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.functions`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.functions`.",
DeprecationWarning, stacklevel=2
)


class GcfHook(CloudFunctionsHook):
"""
This class is deprecated. Please use `airflow.gcp.hooks.functions.CloudFunctionsHook`.
This class is deprecated. Please use `airflow.providers.google.cloud.hooks.functions.CloudFunctionsHook`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. Please use `airflow.gcp.hooks.functions.CloudFunctionsHook`.",
"This class is deprecated. "
"Please use `airflow.providers.google.cloud.hooks.functions.CloudFunctionsHook`.",
DeprecationWarning, stacklevel=2
)

Expand Down
10 changes: 5 additions & 5 deletions airflow/contrib/hooks/gcp_kms_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.kms`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.kms`."""

import warnings

from airflow.gcp.hooks.kms import CloudKMSHook
from airflow.providers.google.cloud.hooks.kms import CloudKMSHook

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.kms`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.kms`.",
DeprecationWarning, stacklevel=2
)


class GoogleCloudKMSHook(CloudKMSHook):
"""
This class is deprecated. Please use `airflow.gcp.hooks.kms.CloudKMSHook`.
This class is deprecated. Please use `airflow.providers.google.cloud.hooks.kms.CloudKMSHook`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. Please use `airflow.gcp.hooks.kms.CloudKMSHook`.",
"This class is deprecated. Please use `airflow.providers.google.cloud.hooks.kms.CloudKMSHook`.",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/gcp_mlengine_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.mlengine`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.mlengine`."""

import warnings

# pylint: disable=unused-import
from airflow.gcp.hooks.mlengine import MLEngineHook # noqa
from airflow.providers.google.cloud.hooks.mlengine import MLEngineHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.mlengine`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.mlengine`.",
DeprecationWarning, stacklevel=2
)
8 changes: 4 additions & 4 deletions airflow/contrib/hooks/gcp_spanner_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use `airflow.gcp.hooks.spanner`."""
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.spanner`."""

import warnings

from airflow.gcp.hooks.spanner import SpannerHook
from airflow.providers.google.cloud.hooks.spanner import SpannerHook

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.spanner`.",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.spanner`.",
DeprecationWarning,
stacklevel=2,
)


class CloudSpannerHook(SpannerHook):
"""
This class is deprecated. Please use `airflow.gcp.hooks.spanner.SpannerHook`.
This class is deprecated. Please use `airflow.providers.google.cloud.hooks.spanner.SpannerHook`.
"""

def __init__(self, *args, **kwargs):
Expand Down
12 changes: 7 additions & 5 deletions airflow/contrib/hooks/gcp_speech_to_text_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,29 @@
# specific language governing permissions and limitations
# under the License.
"""
This module is deprecated. Please use `airflow.gcp.hooks.speech_to_text`.
This module is deprecated. Please use `airflow.providers.google.cloud.hooks.speech_to_text`.
"""

import warnings

from airflow.gcp.hooks.speech_to_text import CloudSpeechToTextHook
from airflow.providers.google.cloud.hooks.speech_to_text import CloudSpeechToTextHook

warnings.warn(
"This module is deprecated. Please use `airflow.gcp.hooks.speech_to_text`",
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.speech_to_text`",
DeprecationWarning, stacklevel=2
)


class GCPSpeechToTextHook(CloudSpeechToTextHook):
"""
This class is deprecated. Please use `airflow.gcp.hooks.speech_to_text.CloudSpeechToTextHook`.
This class is deprecated.
Please use `airflow.providers.google.cloud.hooks.speech_to_text.CloudSpeechToTextHook`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. Please use `airflow.gcp.hooks.speech_to_text.CloudSpeechToTextHook`.",
"This class is deprecated. "
"Please use `airflow.providers.google.cloud.hooks.speech_to_text.CloudSpeechToTextHook`.",
DeprecationWarning, stacklevel=2
)

Expand Down

0 comments on commit 373c6aa

Please sign in to comment.