Skip to content

Commit

Permalink
[AIRFLOW-6115] [AIP-21] Rename GCP vision operators (#7020)
Browse files Browse the repository at this point in the history
ignred unused imports in gcp_vision_operator and fixed test_core_to_contrib
  • Loading branch information
michalslowikowski00 authored and potiuk committed Jan 3, 2020
1 parent e7f5c83 commit 2029947
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 94 deletions.
22 changes: 11 additions & 11 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,20 +545,20 @@ The following table shows changes in import paths.
|airflow.contrib.operators.gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoLabelsOperator |airflow.gcp.operators.video_intelligence.CloudVideoIntelligenceDetectVideoLabelsOperator |
|airflow.contrib.operators.gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoShotsOperator |airflow.gcp.operators.video_intelligence.CloudVideoIntelligenceDetectVideoShotsOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAddProductToProductSetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionAddProductToProductSetOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAnnotateImageOperator |airflow.providers.google.cloud.operators.vision.CloudVisionAnnotateImageOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectDocumentTextOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectDocumentTextOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionAnnotateImageOperator |airflow.providers.google.cloud.operators.vision.CloudVisionImageAnnotateOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectDocumentTextOperator |airflow.providers.google.cloud.operators.vision.CloudVisionTextDetectOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageLabelsOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectImageLabelsOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageSafeSearchOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectImageSafeSearchOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectTextOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDetectTextOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductCreateOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductDeleteOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductGetOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetCreateOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetDeleteOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetGetOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductSetUpdateOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionProductUpdateOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionReferenceImageCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionReferenceImageCreateOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionCreateProductOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDeleteProductOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionGetProductOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionCreateProductSetOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetDeleteOperator |airflow.providers.google.cloud.operators.vision.CloudVisionDeleteProductSetOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionGetProductSetOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionUpdateProductSetOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionProductUpdateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionUpdateProductOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionReferenceImageCreateOperator |airflow.providers.google.cloud.operators.vision.CloudVisionCreateReferenceImageOperator |
|airflow.contrib.operators.gcp_vision_operator.CloudVisionRemoveProductFromProductSetOperator |airflow.providers.google.cloud.operators.vision.CloudVisionRemoveProductFromProductSetOperator |
|airflow.contrib.operators.gcs_acl_operator.GoogleCloudStorageBucketCreateAclEntryOperator |airflow.gcp.operators.gcs.GoogleCloudStorageBucketCreateAclEntryOperator |
|airflow.contrib.operators.gcs_acl_operator.GoogleCloudStorageObjectCreateAclEntryOperator |airflow.gcp.operators.gcs.GoogleCloudStorageObjectCreateAclEntryOperator |
Expand Down
182 changes: 173 additions & 9 deletions airflow/contrib/operators/gcp_vision_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,182 @@

import warnings

# pylint: disable=unused-import
from airflow.providers.google.cloud.operators.vision import ( # noqa
CloudVisionAddProductToProductSetOperator, CloudVisionAnnotateImageOperator,
CloudVisionDetectDocumentTextOperator, CloudVisionDetectImageLabelsOperator,
CloudVisionDetectImageSafeSearchOperator, CloudVisionDetectTextOperator, CloudVisionProductCreateOperator,
CloudVisionProductDeleteOperator, CloudVisionProductGetOperator, CloudVisionProductSetCreateOperator,
CloudVisionProductSetDeleteOperator, CloudVisionProductSetGetOperator,
CloudVisionProductSetUpdateOperator, CloudVisionProductUpdateOperator,
CloudVisionReferenceImageCreateOperator, CloudVisionRemoveProductFromProductSetOperator,
from airflow.providers.google.cloud.operators.vision import ( # noqa # pylint: disable=unused-import
CloudVisionAddProductToProductSetOperator, CloudVisionCreateProductOperator,
CloudVisionCreateProductSetOperator, CloudVisionCreateReferenceImageOperator,
CloudVisionDeleteProductOperator, CloudVisionDeleteProductSetOperator,
CloudVisionDetectImageLabelsOperator, CloudVisionDetectImageSafeSearchOperator,
CloudVisionDetectTextOperator, CloudVisionGetProductOperator, CloudVisionGetProductSetOperator,
CloudVisionImageAnnotateOperator, CloudVisionRemoveProductFromProductSetOperator,
CloudVisionTextDetectOperator, CloudVisionUpdateProductOperator, CloudVisionUpdateProductSetOperator,
)

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


class CloudVisionAnnotateImageOperator(CloudVisionImageAnnotateOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionImageAnnotateOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionImageAnnotateOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionDetectDocumentTextOperator(CloudVisionTextDetectOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionTextDetectOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionTextDetectOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionProductCreateOperator(CloudVisionCreateProductOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionCreateProductOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionCreateProductOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionProductDeleteOperator(CloudVisionDeleteProductOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionDeleteProductOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionDeleteProductOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionProductGetOperator(CloudVisionGetProductOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionGetProductOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionGetProductOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionProductSetCreateOperator(CloudVisionCreateProductSetOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionCreateProductSetOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionCreateProductSetOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionProductSetDeleteOperator(CloudVisionDeleteProductSetOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionDeleteProductSetOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionDeleteProductSetOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionProductSetGetOperator(CloudVisionGetProductSetOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionGetProductSetOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionGetProductSetOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionProductSetUpdateOperator(CloudVisionUpdateProductSetOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionUpdateProductSetOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionUpdateProductSetOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionProductUpdateOperator(CloudVisionUpdateProductOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionUpdateProductOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionUpdateProductOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)


class CloudVisionReferenceImageCreateOperator(CloudVisionCreateReferenceImageOperator):
"""
This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionCreateReferenceImageOperator`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"""This class is deprecated.
Please use `airflow.gcp.operators.vision.CloudVisionCreateReferenceImageOperator`.""",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)
Loading

0 comments on commit 2029947

Please sign in to comment.
  翻译: