You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/16 02:22:27 UTC

[GitHub] [airflow] ferruzzi opened a new pull request #20332: Standardize AWS ECS naming

ferruzzi opened a new pull request #20332:
URL: https://github.com/apache/airflow/pull/20332


   Part of https://github.com/apache/airflow/issues/20296
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ferruzzi commented on a change in pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
ferruzzi commented on a change in pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#discussion_r770178659



##########
File path: airflow/providers/amazon/aws/operators/ecs.py
##########
@@ -508,3 +509,50 @@ def on_kill(self) -> None:
             cluster=self.cluster, task=self.arn, reason='Task killed by the user'
         )
         self.log.info(response)
+
+
+class ECSOperator(EcsOperator):
+    """
+    This operator is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsOperator`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This operator is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsOperator`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSTaskLogFetcher(EcsTaskLogFetcher):
+    """
+    This class is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This class is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSProtocol(EcsProtocol, Protocol):

Review comment:
       @eladkal @uranusjr 
   
   I'm not positive on this one.   It does pass pre-commits and a local CI run like this, but let me know if this should have been handled differently.
   
   Without inheriting 'Protocol' I got an error that only Protocols could inherit another Protocol, so I added that inheritence here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ferruzzi commented on pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
ferruzzi commented on pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#issuecomment-995444193


   Rebased to resolve merge conflicts.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal merged pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
eladkal merged pull request #20332:
URL: https://github.com/apache/airflow/pull/20332


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal edited a comment on pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
eladkal edited a comment on pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#issuecomment-997365558


   We also have
   https://github.com/apache/airflow/blob/1baa648e2af124032c2f2752dc0f587ee253a3a9/airflow/providers/amazon/aws/exceptions.py#L23-L29


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ferruzzi commented on a change in pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
ferruzzi commented on a change in pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#discussion_r770179588



##########
File path: airflow/providers/amazon/aws/operators/ecs.py
##########
@@ -508,3 +509,50 @@ def on_kill(self) -> None:
             cluster=self.cluster, task=self.arn, reason='Task killed by the user'
         )
         self.log.info(response)
+
+
+class ECSOperator(EcsOperator):
+    """
+    This operator is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsOperator`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This operator is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsOperator`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSTaskLogFetcher(EcsTaskLogFetcher):
+    """
+    This class is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This class is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSProtocol(EcsProtocol, Protocol):
+    """
+    This class is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsProtocol`.
+    """
+
+    def __init__(self):
+        warnings.warn(
+            "This class is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsProtocol`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )

Review comment:
       @eladkal @uranusjr
   
   I'm not positive on this one. It does pass pre-commits and a local CI run like this, but let me know if this should have been handled differently.
   
   Without inheriting 'Protocol' I got an error that only Protocols could inherit another Protocol, so I added that inheritence here.  Also, ECSProtocol didn't have an init method so I added one just for the deprecation message, but I'm not sure if that as the right call.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#issuecomment-1005153877


   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ferruzzi commented on a change in pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
ferruzzi commented on a change in pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#discussion_r771158844



##########
File path: airflow/providers/amazon/aws/operators/ecs.py
##########
@@ -508,3 +509,50 @@ def on_kill(self) -> None:
             cluster=self.cluster, task=self.arn, reason='Task killed by the user'
         )
         self.log.info(response)
+
+
+class ECSOperator(EcsOperator):
+    """
+    This operator is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsOperator`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This operator is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsOperator`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSTaskLogFetcher(EcsTaskLogFetcher):
+    """
+    This class is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This class is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSProtocol(EcsProtocol, Protocol):
+    """
+    This class is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsProtocol`.
+    """
+
+    def __init__(self):
+        warnings.warn(
+            "This class is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsProtocol`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )

Review comment:
       See Also:  https://github.com/apache/airflow/pull/20369/files#r771158731




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ferruzzi commented on pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
ferruzzi commented on pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#issuecomment-1004406054


   I was away for the holidays, but I think this one is ready to go?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal commented on pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
eladkal commented on pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#issuecomment-1004596989


   > I was away for the holidays, but I think this one is ready to go?
   
   see https://github.com/apache/airflow/pull/20332#discussion_r772515498
   I wasn't able to reproduce what you described


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ferruzzi commented on a change in pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
ferruzzi commented on a change in pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#discussion_r770178659



##########
File path: airflow/providers/amazon/aws/operators/ecs.py
##########
@@ -508,3 +509,50 @@ def on_kill(self) -> None:
             cluster=self.cluster, task=self.arn, reason='Task killed by the user'
         )
         self.log.info(response)
+
+
+class ECSOperator(EcsOperator):
+    """
+    This operator is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsOperator`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This operator is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsOperator`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSTaskLogFetcher(EcsTaskLogFetcher):
+    """
+    This class is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This class is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSProtocol(EcsProtocol, Protocol):

Review comment:
       @eladkal @uranusjr 
   
   I'm not positive on this one.   It does pass pre-commits and a local CI run like this, but let me know if this should have been handled differently.
   
   Two things happened here:  
   1. Without inheriting 'Protocol' I got an error that only Protocols could inherit another Protocol, so I added that inheritence here.
   
   2. The EcsProtocol doesn't have an __init__ so I'm not sure this is actually correct to call super().__init__().  




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal commented on a change in pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
eladkal commented on a change in pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#discussion_r772515498



##########
File path: airflow/providers/amazon/aws/operators/ecs.py
##########
@@ -508,3 +509,50 @@ def on_kill(self) -> None:
             cluster=self.cluster, task=self.arn, reason='Task killed by the user'
         )
         self.log.info(response)
+
+
+class ECSOperator(EcsOperator):
+    """
+    This operator is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsOperator`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This operator is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsOperator`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSTaskLogFetcher(EcsTaskLogFetcher):
+    """
+    This class is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.
+    """
+
+    def __init__(self, *args, **kwargs):
+        warnings.warn(
+            "This class is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsTaskLogFetcher`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )
+        super().__init__(*args, **kwargs)
+
+
+class ECSProtocol(EcsProtocol, Protocol):
+    """
+    This class is deprecated.
+    Please use :class:`airflow.providers.amazon.aws.operators.ecs.EcsProtocol`.
+    """
+
+    def __init__(self):
+        warnings.warn(
+            "This class is deprecated. "
+            "Please use `airflow.providers.amazon.aws.operators.ecs.EcsProtocol`.",
+            DeprecationWarning,
+            stacklevel=2,
+        )

Review comment:
       I checkout your branch and i'm unable to reproduce the behavior that you are describing.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal commented on pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
eladkal commented on pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#issuecomment-997365558


   We also have
   https://github.com/apache/airflow/blob/main/airflow/providers/amazon/aws/exceptions.py


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ferruzzi commented on a change in pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
ferruzzi commented on a change in pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#discussion_r771928645



##########
File path: airflow/providers/amazon/aws/exceptions.py
##########
@@ -18,12 +18,29 @@
 #
 # Note: Any AirflowException raised is expected to cause the TaskInstance
 #       to be marked in an ERROR state
+import warnings
 
 
-class ECSOperatorError(Exception):
+class EcsOperatorError(Exception):
     """Raise when ECS cannot handle the request."""
 
     def __init__(self, failures: list, message: str):
         self.failures = failures
         self.message = message
         super().__init__(message)

Review comment:
       Are you looking for this @eladkal ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal commented on a change in pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
eladkal commented on a change in pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#discussion_r771928797



##########
File path: airflow/providers/amazon/aws/exceptions.py
##########
@@ -18,12 +18,29 @@
 #
 # Note: Any AirflowException raised is expected to cause the TaskInstance
 #       to be marked in an ERROR state
+import warnings
 
 
-class ECSOperatorError(Exception):
+class EcsOperatorError(Exception):
     """Raise when ECS cannot handle the request."""
 
     def __init__(self, failures: list, message: str):
         self.failures = failures
         self.message = message
         super().__init__(message)

Review comment:
       ahh missed it 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ferruzzi commented on pull request #20332: Standardize AWS ECS naming

Posted by GitBox <gi...@apache.org>.
ferruzzi commented on pull request #20332:
URL: https://github.com/apache/airflow/pull/20332#issuecomment-1005107559


   Huh.   Neither can I now.    I've rebased and removed the `Protocol` inheritance on L546.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org