Skip to content

Commit

Permalink
Update Azure modules to comply with AIP-21 (#19431)
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-fell committed Nov 14, 2021
1 parent 03fc51f commit 4212c49
Show file tree
Hide file tree
Showing 59 changed files with 3,007 additions and 2,696 deletions.
12 changes: 3 additions & 9 deletions airflow/contrib/hooks/azure_container_instance_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,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 :mod:`airflow.providers.microsoft.azure.hooks.azure_container_instance`.
"""
"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.hooks.container_instance`."""

import warnings

from airflow.providers.microsoft.azure.hooks.azure_container_instance import ( # noqa
AzureContainerInstanceHook,
)
from airflow.providers.microsoft.azure.hooks.container_instance import AzureContainerInstanceHook # noqa

warnings.warn(
"This module is deprecated. "
"Please use `airflow.providers.microsoft.azure.hooks.azure_container_instance`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.container_instance`.",
DeprecationWarning,
stacklevel=2,
)
12 changes: 3 additions & 9 deletions airflow/contrib/hooks/azure_container_registry_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,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.providers.microsoft.azure.hooks.azure_container_registry`.
"""
"""This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.container_registry`."""

import warnings

from airflow.providers.microsoft.azure.hooks.azure_container_registry import ( # noqa
AzureContainerRegistryHook,
)
from airflow.providers.microsoft.azure.hooks.container_registry import AzureContainerRegistryHook # noqa

warnings.warn(
"This module is deprecated. "
"Please use `airflow.providers.microsoft.azure.hooks.azure_container_registry`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.container_registry`.",
DeprecationWarning,
stacklevel=2,
)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/azure_container_volume_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
# under the License.
"""
This module is deprecated.
Please use :mod:`airflow.providers.microsoft.azure.hooks.azure_container_volume`.
Please use :mod:`airflow.providers.microsoft.azure.hooks.container_volume`.
"""

import warnings

from airflow.providers.microsoft.azure.hooks.azure_container_volume import AzureContainerVolumeHook # noqa
from airflow.providers.microsoft.azure.hooks.container_volume import AzureContainerVolumeHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.azure_container_volume`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.container_volume`.",
DeprecationWarning,
stacklevel=2,
)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/azure_cosmos_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,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 :mod:`airflow.providers.microsoft.azure.hooks.azure_cosmos`."""
"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.hooks.cosmos`."""

import warnings

from airflow.providers.microsoft.azure.hooks.azure_cosmos import AzureCosmosDBHook # noqa
from airflow.providers.microsoft.azure.hooks.cosmos import AzureCosmosDBHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.azure_cosmos`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.cosmos`.",
DeprecationWarning,
stacklevel=2,
)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/azure_data_lake_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,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 :mod:`airflow.providers.microsoft.azure.hooks.azure_data_lake`."""
"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.hooks.data_lake`."""

import warnings

from airflow.providers.microsoft.azure.hooks.azure_data_lake import AzureDataLakeHook # noqa
from airflow.providers.microsoft.azure.hooks.data_lake import AzureDataLakeHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.azure_data_lake`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.data_lake`.",
DeprecationWarning,
stacklevel=2,
)
6 changes: 3 additions & 3 deletions airflow/contrib/hooks/azure_fileshare_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,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 :mod:`airflow.providers.microsoft.azure.hooks.azure_fileshare`."""
"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.hooks.fileshare`."""

import warnings

from airflow.providers.microsoft.azure.hooks.azure_fileshare import AzureFileShareHook # noqa
from airflow.providers.microsoft.azure.hooks.fileshare import AzureFileShareHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.azure_fileshare`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.hooks.fileshare`.",
DeprecationWarning,
stacklevel=2,
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
# under the License.
"""
This module is deprecated. Please use
`airflow.providers.microsoft.azure.operators.azure_container_instances`.
`airflow.providers.microsoft.azure.operators.container_instances`.
"""
import warnings

from airflow.providers.microsoft.azure.operators.azure_container_instances import ( # noqa
from airflow.providers.microsoft.azure.operators.container_instances import ( # noqa
AzureContainerInstancesOperator,
)

warnings.warn(
"This module is deprecated. "
"Please use `airflow.providers.microsoft.azure.operators.azure_container_instances`.",
"Please use `airflow.providers.microsoft.azure.operators.container_instances`.",
DeprecationWarning,
stacklevel=2,
)
6 changes: 3 additions & 3 deletions airflow/contrib/operators/azure_cosmos_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,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 :mod:`airflow.providers.microsoft.azure.operators.azure_cosmos`."""
"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.operators.cosmos`."""

import warnings

from airflow.providers.microsoft.azure.operators.azure_cosmos import AzureCosmosInsertDocumentOperator # noqa
from airflow.providers.microsoft.azure.operators.cosmos import AzureCosmosInsertDocumentOperator # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.microsoft.azure.operators.azure_cosmos`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.operators.cosmos`.",
DeprecationWarning,
stacklevel=2,
)
6 changes: 3 additions & 3 deletions airflow/contrib/secrets/azure_key_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# specific language governing permissions and limitations
# under the License.

"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.secrets.azure_key_vault`."""
"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.secrets.key_vault`."""

import warnings

from airflow.providers.microsoft.azure.secrets.azure_key_vault import AzureKeyVaultBackend # noqa
from airflow.providers.microsoft.azure.secrets.key_vault import AzureKeyVaultBackend # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.microsoft.azure.secrets.azure_key_vault`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.secrets.key_vault`.",
DeprecationWarning,
stacklevel=2,
)
6 changes: 3 additions & 3 deletions airflow/contrib/sensors/azure_cosmos_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,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 :mod:`airflow.providers.microsoft.azure.sensors.azure_cosmos`."""
"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.sensors.cosmos`."""

import warnings

from airflow.providers.microsoft.azure.sensors.azure_cosmos import AzureCosmosDocumentSensor # noqa
from airflow.providers.microsoft.azure.sensors.cosmos import AzureCosmosDocumentSensor # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.microsoft.azure.sensors.azure_cosmos`.",
"This module is deprecated. Please use `airflow.providers.microsoft.azure.sensors.cosmos`.",
DeprecationWarning,
stacklevel=2,
)
2 changes: 1 addition & 1 deletion airflow/providers/google/cloud/transfers/adls_to_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from typing import Optional, Sequence, Union

from airflow.providers.google.cloud.hooks.gcs import GCSHook, _parse_gcs_url
from airflow.providers.microsoft.azure.hooks.azure_data_lake import AzureDataLakeHook
from airflow.providers.microsoft.azure.hooks.data_lake import AzureDataLakeHook
from airflow.providers.microsoft.azure.operators.adls import ADLSListOperator


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from airflow import AirflowException
from airflow.models import BaseOperator
from airflow.providers.google.cloud.hooks.gcs import GCSHook, _parse_gcs_url, gcs_object_is_directory
from airflow.providers.microsoft.azure.hooks.azure_fileshare import AzureFileShareHook
from airflow.providers.microsoft.azure.hooks.fileshare import AzureFileShareHook


class AzureFileShareToGCSOperator(BaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
from datetime import datetime, timedelta

from airflow import DAG
from airflow.providers.microsoft.azure.operators.azure_container_instances import (
AzureContainerInstancesOperator,
)
from airflow.providers.microsoft.azure.operators.container_instances import AzureContainerInstancesOperator

with DAG(
dag_id='aci_example',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
from datetime import datetime

from airflow import DAG
from airflow.providers.microsoft.azure.operators.azure_cosmos import AzureCosmosInsertDocumentOperator
from airflow.providers.microsoft.azure.sensors.azure_cosmos import AzureCosmosDocumentSensor
from airflow.providers.microsoft.azure.operators.cosmos import AzureCosmosInsertDocumentOperator
from airflow.providers.microsoft.azure.sensors.cosmos import AzureCosmosDocumentSensor

with DAG(
dag_id='example_azure_cosmosdb_sensor',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from airflow.decorators import task
from airflow.models import DAG
from airflow.providers.microsoft.azure.hooks.azure_fileshare import AzureFileShareHook
from airflow.providers.microsoft.azure.hooks.fileshare import AzureFileShareHook

NAME = 'myfileshare'
DIRECTORY = "mydirectory"
Expand Down
Loading

0 comments on commit 4212c49

Please sign in to comment.