dstandish commented on code in PR #41868:
URL: https://github.com/apache/airflow/pull/41868#discussion_r1742784826


##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -391,9 +391,7 @@ def __init__(
         self.skip_on_exit_code = (
             skip_on_exit_code
             if isinstance(skip_on_exit_code, Container)
-            else [skip_on_exit_code]
-            if skip_on_exit_code is not None
-            else []
+            else [skip_on_exit_code] if skip_on_exit_code is not None else []

Review Comment:
   I would like to suggest this instead:
   ```
       self.skip_on_exit_code = None
       if isinstance(skip_on_exit_code, Container):
           self.skip_on_exit_code = skip_on_exit_code
       elif skip_on_exit_code:
           self.skip_on_exit_code = skip_on_exit_code
   ```
   why:
   The multiple  if elses in the comprehension are hard to follow.  And, I 
think it's nice to use None when there's no value (instead of empty list) and I 
looked at where this is used and it seems it should work the same.
   I think it's nice to use None instead of empty list .



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to