Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit f2caa45

Browse files
louisguittonfeluelle
authored andcommitted
[AIRFLOW-5742] Move Google Cloud Vision to providers package (apache#6424)
1 parent 4132f3b commit f2caa45

File tree

22 files changed

+349
-228
lines changed

22 files changed

+349
-228
lines changed

UPDATING.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ The following table shows changes in import paths.
218218
|airflow.contrib.hooks.gcp_transfer_hook.GCPTransferServiceHook |airflow.gcp.hooks.cloud_storage_transfer_service.GCPTransferServiceHook |
219219
|airflow.contrib.hooks.gcp_translate_hook.CloudTranslateHook |airflow.gcp.hooks.translate.CloudTranslateHook |
220220
|airflow.contrib.hooks.gcp_video_intelligence_hook.CloudVideoIntelligenceHook |airflow.gcp.hooks.video_intelligence.CloudVideoIntelligenceHook |
221-
|airflow.contrib.hooks.gcp_vision_hook.CloudVisionHook |airflow.gcp.hooks.vision.CloudVisionHook |
221+
|airflow.contrib.hooks.gcp_vision_hook.CloudVisionHook |airflow.providers.google.cloud.hooks.vision.CloudVisionHook |
222222
|airflow.contrib.hooks.gcs_hook.GoogleCloudStorageHook |airflow.gcp.hooks.gcs.GoogleCloudStorageHook |
223223
|airflow.contrib.operators.adls_to_gcs.AdlsToGoogleCloudStorageOperator |airflow.operators.adls_to_gcs.AdlsToGoogleCloudStorageOperator |
224224
|airflow.contrib.operators.bigquery_check_operator.BigQueryCheckOperator |airflow.gcp.operators.bigquery.BigQueryCheckOperator |
@@ -327,22 +327,22 @@ The following table shows changes in import paths.
327327
|airflow.contrib.operators.gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoExplicitContentOperator|airflow.gcp.operators.video_intelligence.CloudVideoIntelligenceDetectVideoExplicitContentOperator |
328328
|airflow.contrib.operators.gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoLabelsOperator |airflow.gcp.operators.video_intelligence.CloudVideoIntelligenceDetectVideoLabelsOperator |
329329
|airflow.contrib.operators.gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoShotsOperator |airflow.gcp.operators.video_intelligence.CloudVideoIntelligenceDetectVideoShotsOperator |
330-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAddProductToProductSetOperator |airflow.gcp.operators.vision.CloudVisionAddProductToProductSetOperator |
331-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAnnotateImageOperator |airflow.gcp.operators.vision.CloudVisionAnnotateImageOperator |
332-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectDocumentTextOperator |airflow.gcp.operators.vision.CloudVisionDetectDocumentTextOperator |
333-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageLabelsOperator |airflow.gcp.operators.vision.CloudVisionDetectImageLabelsOperator |
334-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageSafeSearchOperator |airflow.gcp.operators.vision.CloudVisionDetectImageSafeSearchOperator |
335-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectTextOperator |airflow.gcp.operators.vision.CloudVisionDetectTextOperator |
336-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductCreateOperator |airflow.gcp.operators.vision.CloudVisionProductCreateOperator |
337-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductDeleteOperator |airflow.gcp.operators.vision.CloudVisionProductDeleteOperator |
338-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductGetOperator |airflow.gcp.operators.vision.CloudVisionProductGetOperator |
339-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetCreateOperator |airflow.gcp.operators.vision.CloudVisionProductSetCreateOperator |
340-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetDeleteOperator |airflow.gcp.operators.vision.CloudVisionProductSetDeleteOperator |
341-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator |airflow.gcp.operators.vision.CloudVisionProductSetGetOperator |
342-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetUpdateOperator |airflow.gcp.operators.vision.CloudVisionProductSetUpdateOperator |
343-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductUpdateOperator |airflow.gcp.operators.vision.CloudVisionProductUpdateOperator |
344-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionReferenceImageCreateOperator |airflow.gcp.operators.vision.CloudVisionReferenceImageCreateOperator |
345-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionRemoveProductFromProductSetOperator |airflow.gcp.operators.vision.CloudVisionRemoveProductFromProductSetOperator |
330+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAddProductToProductSetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionAddProductToProductSetOperator |
331+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAnnotateImageOperator |airflow.providers.google.cloud.operators.vision.CloudVisionAnnotateImageOperator |
332+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectDocumentTextOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectDocumentTextOperator |
333+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageLabelsOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectImageLabelsOperator |
334+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageSafeSearchOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectImageSafeSearchOperator |
335+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectTextOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectTextOperator |
336+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductCreateOperator |
337+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductDeleteOperator |
338+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductGetOperator |
339+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetCreateOperator |
340+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetDeleteOperator |
341+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetGetOperator |
342+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetUpdateOperator |
343+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductUpdateOperator |
344+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionReferenceImageCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionReferenceImageCreateOperator |
345+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionRemoveProductFromProductSetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionRemoveProductFromProductSetOperator |
346346
|airflow.contrib.operators.gcs_acl_operator.GoogleCloudStorageBucketCreateAclEntryOperator |airflow.gcp.operators.gcs.GoogleCloudStorageBucketCreateAclEntryOperator |
347347
|airflow.contrib.operators.gcs_acl_operator.GoogleCloudStorageObjectCreateAclEntryOperator |airflow.gcp.operators.gcs.GoogleCloudStorageObjectCreateAclEntryOperator |
348348
|airflow.contrib.operators.gcs_delete_operator.GoogleCloudStorageDeleteOperator |airflow.gcp.operators.gcs.GoogleCloudStorageDeleteOperator |

airflow/contrib/hooks/gcp_vision_hook.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
# specific language governing permissions and limitations
1818
# under the License.
1919
"""
20-
This module is deprecated. Please use `airflow.gcp.hooks.vision`.
20+
This module is deprecated. Please use `airflow.providers.google.cloud.hooks.vision`.
2121
"""
2222

2323
import warnings
2424

2525
# pylint: disable=unused-import
26-
from airflow.gcp.hooks.vision import CloudVisionHook # noqa
26+
from airflow.providers.google.cloud.hooks.vision import CloudVisionHook # noqa
2727

2828
warnings.warn(
29-
"This module is deprecated. Please use `airflow.gcp.hooks.vision`.",
29+
"This module is deprecated. Please use `airflow.providers.google.cloud.hooks.vision`.",
3030
DeprecationWarning, stacklevel=2
3131
)

airflow/contrib/operators/gcp_vision_operator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
# specific language governing permissions and limitations
1818
# under the License.
1919
"""
20-
This module is deprecated. Please use `airflow.gcp.operators.vision`.
20+
This module is deprecated. Please use `airflow.providers.google.cloud.operators.vision`.
2121
"""
2222

2323
import warnings
2424

2525
# pylint: disable=unused-import
26-
from airflow.gcp.operators.vision import ( # noqa
26+
from airflow.providers.google.cloud.operators.vision import ( # noqa
2727
CloudVisionAddProductToProductSetOperator, CloudVisionAnnotateImageOperator,
2828
CloudVisionDetectDocumentTextOperator, CloudVisionDetectImageLabelsOperator,
2929
CloudVisionDetectImageSafeSearchOperator, CloudVisionDetectTextOperator, CloudVisionProductCreateOperator,
@@ -34,6 +34,6 @@
3434
)
3535

3636
warnings.warn(
37-
"This module is deprecated. Please use `airflow.gcp.operators.vision`.",
37+
"This module is deprecated. Please use `airflow.providers.google.cloud.operators.vision`.",
3838
DeprecationWarning, stacklevel=2
3939
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.

airflow/gcp/example_dags/example_vision.py renamed to airflow/providers/google/cloud/example_dags/example_vision.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636

3737
import airflow
3838
from airflow import models
39-
from airflow.gcp.operators.vision import (
39+
from airflow.operators.bash_operator import BashOperator
40+
from airflow.providers.google.cloud.operators.vision import (
4041
CloudVisionAddProductToProductSetOperator, CloudVisionAnnotateImageOperator,
4142
CloudVisionDetectDocumentTextOperator, CloudVisionDetectImageLabelsOperator,
4243
CloudVisionDetectImageSafeSearchOperator, CloudVisionDetectTextOperator, CloudVisionProductCreateOperator,
@@ -45,7 +46,6 @@
4546
CloudVisionProductSetUpdateOperator, CloudVisionProductUpdateOperator,
4647
CloudVisionReferenceImageCreateOperator, CloudVisionRemoveProductFromProductSetOperator,
4748
)
48-
from airflow.operators.bash_operator import BashOperator
4949

5050
# [START howto_operator_vision_retry_import]
5151
from google.api_core.retry import Retry # isort:skip pylint: disable=wrong-import-order
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.

airflow/gcp/operators/vision.py renamed to airflow/providers/google/cloud/operators/vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
AnnotateImageRequest, FieldMask, Image, Product, ProductSet, ReferenceImage,
3030
)
3131

32-
from airflow.gcp.hooks.vision import CloudVisionHook
3332
from airflow.models import BaseOperator
33+
from airflow.providers.google.cloud.hooks.vision import CloudVisionHook
3434
from airflow.utils.decorators import apply_defaults
3535

3636
MetaData = Sequence[Tuple[str, str]]

docs/autoapi_templates/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ All operators are in the following packages:
7272

7373
airflow/gcp/sensors/index
7474

75+
airflow/providers/google/cloud/operators/index
76+
7577
airflow/providers/google/marketing_platform/operators/index
7678

7779
airflow/providers/google/marketing_platform/sensors/index
@@ -98,6 +100,8 @@ All hooks are in the following packages:
98100

99101
airflow/gcp/hooks/index
100102

103+
airflow/providers/google/cloud/hooks/index
104+
101105
airflow/providers/google/marketing_platform/hooks/index
102106

103107

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@
211211
'_api/airflow/gcp/utils',
212212
'_api/airflow/providers/index.rst',
213213
'_api/airflow/providers/google/index.rst',
214+
'_api/airflow/providers/google/cloud/index.rst',
215+
'_api/airflow/providers/google/cloud/example_dags',
214216
'_api/airflow/providers/google/marketing_platform/index.rst',
215217
'_api/airflow/providers/google/marketing_platform/example_dags',
216218
'autoapi_templates',

0 commit comments

Comments
 (0)