Skip to content

Commit 2029947

Browse files
michalslowikowski00potiuk
authored andcommitted
[AIRFLOW-6115] [AIP-21] Rename GCP vision operators (#7020)
ignred unused imports in gcp_vision_operator and fixed test_core_to_contrib
1 parent e7f5c83 commit 2029947

File tree

6 files changed

+258
-94
lines changed

6 files changed

+258
-94
lines changed

β€ŽUPDATING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -545,20 +545,20 @@ The following table shows changes in import paths.
545545
|airflow.contrib.operators.gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoLabelsOperator |airflow.gcp.operators.video_intelligence.CloudVideoIntelligenceDetectVideoLabelsOperator |
546546
|airflow.contrib.operators.gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoShotsOperator |airflow.gcp.operators.video_intelligence.CloudVideoIntelligenceDetectVideoShotsOperator |
547547
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAddProductToProductSetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionAddProductToProductSetOperator |
548-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAnnotateImageOperator |airflow.providers.google.cloud.operators.vision.CloudVisionAnnotateImageOperator |
549-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectDocumentTextOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectDocumentTextOperator |
548+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAnnotateImageOperator |airflow.providers.google.cloud.operators.vision.CloudVisionImageAnnotateOperator |
549+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectDocumentTextOperator |airflow.providers.google.cloud.operators.vision.CloudVisionTextDetectOperator |
550550
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageLabelsOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectImageLabelsOperator |
551551
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageSafeSearchOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectImageSafeSearchOperator |
552552
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectTextOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectTextOperator |
553-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductCreateOperator |
554-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductDeleteOperator |
555-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductGetOperator |
556-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetCreateOperator |
557-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetDeleteOperator |
558-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetGetOperator |
559-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetUpdateOperator |
560-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductUpdateOperator |
561-
|airflow.contrib.operators.gcp_vision_operator.CloudVisionReferenceImageCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionReferenceImageCreateOperator |
553+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionCreateProductOperator |
554+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDeleteProductOperator |
555+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionGetProductOperator |
556+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionCreateProductSetOperator |
557+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDeleteProductSetOperator |
558+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionGetProductSetOperator |
559+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionUpdateProductSetOperator |
560+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionUpdateProductOperator |
561+
|airflow.contrib.operators.gcp_vision_operator.CloudVisionReferenceImageCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionCreateReferenceImageOperator |
562562
|airflow.contrib.operators.gcp_vision_operator.CloudVisionRemoveProductFromProductSetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionRemoveProductFromProductSetOperator |
563563
|airflow.contrib.operators.gcs_acl_operator.GoogleCloudStorageBucketCreateAclEntryOperator |airflow.gcp.operators.gcs.GoogleCloudStorageBucketCreateAclEntryOperator |
564564
|airflow.contrib.operators.gcs_acl_operator.GoogleCloudStorageObjectCreateAclEntryOperator |airflow.gcp.operators.gcs.GoogleCloudStorageObjectCreateAclEntryOperator |

β€Žairflow/contrib/operators/gcp_vision_operator.py

Lines changed: 173 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,182 @@
2222

2323
import warnings
2424

25-
# pylint: disable=unused-import
26-
from airflow.providers.google.cloud.operators.vision import ( # noqa
27-
CloudVisionAddProductToProductSetOperator, CloudVisionAnnotateImageOperator,
28-
CloudVisionDetectDocumentTextOperator, CloudVisionDetectImageLabelsOperator,
29-
CloudVisionDetectImageSafeSearchOperator, CloudVisionDetectTextOperator, CloudVisionProductCreateOperator,
30-
CloudVisionProductDeleteOperator, CloudVisionProductGetOperator, CloudVisionProductSetCreateOperator,
31-
CloudVisionProductSetDeleteOperator, CloudVisionProductSetGetOperator,
32-
CloudVisionProductSetUpdateOperator, CloudVisionProductUpdateOperator,
33-
CloudVisionReferenceImageCreateOperator, CloudVisionRemoveProductFromProductSetOperator,
25+
from airflow.providers.google.cloud.operators.vision import ( # noqa # pylint: disable=unused-import
26+
CloudVisionAddProductToProductSetOperator, CloudVisionCreateProductOperator,
27+
CloudVisionCreateProductSetOperator, CloudVisionCreateReferenceImageOperator,
28+
CloudVisionDeleteProductOperator, CloudVisionDeleteProductSetOperator,
29+
CloudVisionDetectImageLabelsOperator, CloudVisionDetectImageSafeSearchOperator,
30+
CloudVisionDetectTextOperator, CloudVisionGetProductOperator, CloudVisionGetProductSetOperator,
31+
CloudVisionImageAnnotateOperator, CloudVisionRemoveProductFromProductSetOperator,
32+
CloudVisionTextDetectOperator, CloudVisionUpdateProductOperator, CloudVisionUpdateProductSetOperator,
3433
)
3534

3635
warnings.warn(
3736
"This module is deprecated. Please use `airflow.providers.google.cloud.operators.vision`.",
3837
DeprecationWarning, stacklevel=2
3938
)
39+
40+
41+
class CloudVisionAnnotateImageOperator(CloudVisionImageAnnotateOperator):
42+
"""
43+
This class is deprecated.
44+
Please use `airflow.gcp.operators.vision.CloudVisionImageAnnotateOperator`.
45+
"""
46+
47+
def __init__(self, *args, **kwargs):
48+
warnings.warn(
49+
"""This class is deprecated.
50+
Please use `airflow.gcp.operators.vision.CloudVisionImageAnnotateOperator`.""",
51+
DeprecationWarning, stacklevel=2
52+
)
53+
super().__init__(*args, **kwargs)
54+
55+
56+
class CloudVisionDetectDocumentTextOperator(CloudVisionTextDetectOperator):
57+
"""
58+
This class is deprecated.
59+
Please use `airflow.gcp.operators.vision.CloudVisionTextDetectOperator`.
60+
"""
61+
62+
def __init__(self, *args, **kwargs):
63+
warnings.warn(
64+
"""This class is deprecated.
65+
Please use `airflow.gcp.operators.vision.CloudVisionTextDetectOperator`.""",
66+
DeprecationWarning, stacklevel=2
67+
)
68+
super().__init__(*args, **kwargs)
69+
70+
71+
class CloudVisionProductCreateOperator(CloudVisionCreateProductOperator):
72+
"""
73+
This class is deprecated.
74+
Please use `airflow.gcp.operators.vision.CloudVisionCreateProductOperator`.
75+
"""
76+
77+
def __init__(self, *args, **kwargs):
78+
warnings.warn(
79+
"""This class is deprecated.
80+
Please use `airflow.gcp.operators.vision.CloudVisionCreateProductOperator`.""",
81+
DeprecationWarning, stacklevel=2
82+
)
83+
super().__init__(*args, **kwargs)
84+
85+
86+
class CloudVisionProductDeleteOperator(CloudVisionDeleteProductOperator):
87+
"""
88+
This class is deprecated.
89+
Please use `airflow.gcp.operators.vision.CloudVisionDeleteProductOperator`.
90+
"""
91+
92+
def __init__(self, *args, **kwargs):
93+
warnings.warn(
94+
"""This class is deprecated.
95+
Please use `airflow.gcp.operators.vision.CloudVisionDeleteProductOperator`.""",
96+
DeprecationWarning, stacklevel=2
97+
)
98+
super().__init__(*args, **kwargs)
99+
100+
101+
class CloudVisionProductGetOperator(CloudVisionGetProductOperator):
102+
"""
103+
This class is deprecated.
104+
Please use `airflow.gcp.operators.vision.CloudVisionGetProductOperator`.
105+
"""
106+
107+
def __init__(self, *args, **kwargs):
108+
warnings.warn(
109+
"""This class is deprecated.
110+
Please use `airflow.gcp.operators.vision.CloudVisionGetProductOperator`.""",
111+
DeprecationWarning, stacklevel=2
112+
)
113+
super().__init__(*args, **kwargs)
114+
115+
116+
class CloudVisionProductSetCreateOperator(CloudVisionCreateProductSetOperator):
117+
"""
118+
This class is deprecated.
119+
Please use `airflow.gcp.operators.vision.CloudVisionCreateProductSetOperator`.
120+
"""
121+
122+
def __init__(self, *args, **kwargs):
123+
warnings.warn(
124+
"""This class is deprecated.
125+
Please use `airflow.gcp.operators.vision.CloudVisionCreateProductSetOperator`.""",
126+
DeprecationWarning, stacklevel=2
127+
)
128+
super().__init__(*args, **kwargs)
129+
130+
131+
class CloudVisionProductSetDeleteOperator(CloudVisionDeleteProductSetOperator):
132+
"""
133+
This class is deprecated.
134+
Please use `airflow.gcp.operators.vision.CloudVisionDeleteProductSetOperator`.
135+
"""
136+
137+
def __init__(self, *args, **kwargs):
138+
warnings.warn(
139+
"""This class is deprecated.
140+
Please use `airflow.gcp.operators.vision.CloudVisionDeleteProductSetOperator`.""",
141+
DeprecationWarning, stacklevel=2
142+
)
143+
super().__init__(*args, **kwargs)
144+
145+
146+
class CloudVisionProductSetGetOperator(CloudVisionGetProductSetOperator):
147+
"""
148+
This class is deprecated.
149+
Please use `airflow.gcp.operators.vision.CloudVisionGetProductSetOperator`.
150+
"""
151+
152+
def __init__(self, *args, **kwargs):
153+
warnings.warn(
154+
"""This class is deprecated.
155+
Please use `airflow.gcp.operators.vision.CloudVisionGetProductSetOperator`.""",
156+
DeprecationWarning, stacklevel=2
157+
)
158+
super().__init__(*args, **kwargs)
159+
160+
161+
class CloudVisionProductSetUpdateOperator(CloudVisionUpdateProductSetOperator):
162+
"""
163+
This class is deprecated.
164+
Please use `airflow.gcp.operators.vision.CloudVisionUpdateProductSetOperator`.
165+
"""
166+
167+
def __init__(self, *args, **kwargs):
168+
warnings.warn(
169+
"""This class is deprecated.
170+
Please use `airflow.gcp.operators.vision.CloudVisionUpdateProductSetOperator`.""",
171+
DeprecationWarning, stacklevel=2
172+
)
173+
super().__init__(*args, **kwargs)
174+
175+
176+
class CloudVisionProductUpdateOperator(CloudVisionUpdateProductOperator):
177+
"""
178+
This class is deprecated.
179+
Please use `airflow.gcp.operators.vision.CloudVisionUpdateProductOperator`.
180+
"""
181+
182+
def __init__(self, *args, **kwargs):
183+
warnings.warn(
184+
"""This class is deprecated.
185+
Please use `airflow.gcp.operators.vision.CloudVisionUpdateProductOperator`.""",
186+
DeprecationWarning, stacklevel=2
187+
)
188+
super().__init__(*args, **kwargs)
189+
190+
191+
class CloudVisionReferenceImageCreateOperator(CloudVisionCreateReferenceImageOperator):
192+
"""
193+
This class is deprecated.
194+
Please use `airflow.gcp.operators.vision.CloudVisionCreateReferenceImageOperator`.
195+
"""
196+
197+
def __init__(self, *args, **kwargs):
198+
warnings.warn(
199+
"""This class is deprecated.
200+
Please use `airflow.gcp.operators.vision.CloudVisionCreateReferenceImageOperator`.""",
201+
DeprecationWarning, stacklevel=2
202+
)
203+
super().__init__(*args, **kwargs)

0 commit comments

Comments
 (0)