You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2023/03/02 11:00:01 UTC

[GitHub] [airflow] Taragolis opened a new pull request, #29871: Fix Amazon ECS Enums

Taragolis opened a new pull request, #29871:
URL: https://github.com/apache/airflow/pull/29871

   Follow-up: https://github.com/apache/airflow/pull/29761#issuecomment-1451039707
   


-- 
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] o-nikolas commented on a diff in pull request #29871: Fix Amazon ECS Enums

Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on code in PR #29871:
URL: https://github.com/apache/airflow/pull/29871#discussion_r1123521462


##########
airflow/providers/amazon/aws/hooks/ecs.py:
##########
@@ -55,7 +55,24 @@ def should_retry_eni(exception: Exception):
     return False
 
 
-class EcsClusterStates(str, Enum):
+class _StringCompareEnum(Enum):

Review Comment:
   Should we put this in a more general place so that other modules can make use of it? 



##########
airflow/providers/amazon/aws/hooks/ecs.py:
##########
@@ -55,7 +55,24 @@ def should_retry_eni(exception: Exception):
     return False
 
 
-class EcsClusterStates(str, Enum):
+class _StringCompareEnum(Enum):
+    """
+    Enum which could be compared with regular `str` and subclasses.
+
+    This class for avoid multiple inheritance such as AwesomeEnum(str, Enum)
+    which is not work well with templated_fields, and Jinja templates.

Review Comment:
   ```suggestion
       Enum which can be compared with regular `str` and subclasses.
   
       This class avoids multiple inheritance such as AwesomeEnum(str, Enum)
       which does not work well with templated_fields and Jinja templates.
   ```



-- 
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] o-nikolas merged pull request #29871: Fix Amazon ECS Enums

Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas merged PR #29871:
URL: https://github.com/apache/airflow/pull/29871


-- 
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] vincbeck commented on a diff in pull request #29871: Fix Amazon ECS Enums

Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #29871:
URL: https://github.com/apache/airflow/pull/29871#discussion_r1123582113


##########
airflow/providers/amazon/aws/hooks/ecs.py:
##########
@@ -55,7 +55,24 @@ def should_retry_eni(exception: Exception):
     return False
 
 
-class EcsClusterStates(str, Enum):
+class _StringCompareEnum(Enum):

Review Comment:
   Agree. We might want to do it now? It'd encourage others to use if needed instead of copy pasting 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] Taragolis commented on a diff in pull request #29871: Fix Amazon ECS Enums

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #29871:
URL: https://github.com/apache/airflow/pull/29871#discussion_r1123531262


##########
airflow/providers/amazon/aws/hooks/ecs.py:
##########
@@ -55,7 +55,24 @@ def should_retry_eni(exception: Exception):
     return False
 
 
-class EcsClusterStates(str, Enum):
+class _StringCompareEnum(Enum):

Review Comment:
   Right now it just for fix but in general we could move it later if it useful for other places, that why I make it "private"



-- 
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] vincbeck commented on a diff in pull request #29871: Fix Amazon ECS Enums

Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #29871:
URL: https://github.com/apache/airflow/pull/29871#discussion_r1123591998


##########
airflow/providers/amazon/aws/hooks/ecs.py:
##########
@@ -55,7 +55,24 @@ def should_retry_eni(exception: Exception):
     return False
 
 
-class EcsClusterStates(str, Enum):
+class _StringCompareEnum(Enum):

Review Comment:
   Sounds good to me :)



-- 
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] Taragolis commented on pull request #29871: Fix Amazon ECS Enums

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on PR #29871:
URL: https://github.com/apache/airflow/pull/29871#issuecomment-1452262756

   I've just figure out that there is no tests for ECS Sensors 🙄 


-- 
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 diff in pull request #29871: Fix Amazon ECS Enums

Posted by "ferruzzi (via GitHub)" <gi...@apache.org>.
ferruzzi commented on code in PR #29871:
URL: https://github.com/apache/airflow/pull/29871#discussion_r1123531685


##########
airflow/providers/amazon/aws/hooks/ecs.py:
##########
@@ -55,7 +55,24 @@ def should_retry_eni(exception: Exception):
     return False
 
 
-class EcsClusterStates(str, Enum):
+class _StringCompareEnum(Enum):

Review Comment:
   I was thinking the same thing.  Seems like something we'll want to reuse.



-- 
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] o-nikolas commented on a diff in pull request #29871: Fix Amazon ECS Enums

Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on code in PR #29871:
URL: https://github.com/apache/airflow/pull/29871#discussion_r1123582402


##########
airflow/providers/amazon/aws/hooks/ecs.py:
##########
@@ -55,7 +55,24 @@ def should_retry_eni(exception: Exception):
     return False
 
 
-class EcsClusterStates(str, Enum):
+class _StringCompareEnum(Enum):

Review Comment:
   I feel like it is quite trivial to move it to a more generic place (and still keep it private if you'd prefer that). Seems easy to make the right choice now rather than having to fix it later. But I wont press any harder, happy to merge this as is and I can fix it in a follow up PR :+1: 



-- 
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] Taragolis commented on a diff in pull request #29871: Fix Amazon ECS Enums

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #29871:
URL: https://github.com/apache/airflow/pull/29871#discussion_r1123587735


##########
airflow/providers/amazon/aws/hooks/ecs.py:
##########
@@ -55,7 +55,24 @@ def should_retry_eni(exception: Exception):
     return False
 
 
-class EcsClusterStates(str, Enum):
+class _StringCompareEnum(Enum):

Review Comment:
   I'd rather move it in separate PR when we actually need this functional. Just for avoid spending time to choose better name and better place 🤣  



-- 
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 #29871: Fix Amazon ECS Enums

Posted by "ferruzzi (via GitHub)" <gi...@apache.org>.
ferruzzi commented on PR #29871:
URL: https://github.com/apache/airflow/pull/29871#issuecomment-1452321027

   Thanks for getting this so fast, I was planning to look at it this morning.  :+1: 
   
   LOL.  I did a review and it wouldn't let me submit because Niko left the same two comments while I was typing.  :+1: 


-- 
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