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 2022/07/01 18:06:54 UTC

[GitHub] [airflow] dstandish opened a new pull request, #24787: Helper exactly_one should treat NOTSET as None

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

   This is maybe technically breaking but I would wager 0% chance of breaking anything in the real world.
   
   The way this helper is intended, and the way it is used, I think it makes sense to treat NOTSET the same as None.
   
   WDYT @jedcunningham @uranusjr @ashb 


-- 
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] dstandish closed pull request #24787: Helper exactly_one should treat NOTSET as None

Posted by GitBox <gi...@apache.org>.
dstandish closed pull request #24787: Helper exactly_one should treat NOTSET as None
URL: https://github.com/apache/airflow/pull/24787


-- 
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 #24787: Helper exactly_one should treat NOTSET as None

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

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.


-- 
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] uranusjr commented on a diff in pull request #24787: Helper exactly_one should treat NOTSET as None

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #24787:
URL: https://github.com/apache/airflow/pull/24787#discussion_r912692169


##########
airflow/utils/helpers.py:
##########
@@ -311,7 +312,14 @@ def exactly_one(*args) -> bool:
         raise ValueError(
             "Not supported for iterable args. Use `*` to unpack your iterable in the function call."
         )
-    return sum(map(bool, args)) == 1
+
+    def is_set(val):
+        if isinstance(val, ArgNotSet):
+            return False
+        else:
+            return bool(val)
+
+    return sum(map(is_set, args)) == 1

Review Comment:
   ```suggestion
       return sum(a is not NOT_SET and bool(a) for a in args) == 1
   ```
   
   Does this read better?



-- 
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] closed pull request #24787: Helper exactly_one should treat NOTSET as None

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #24787: Helper exactly_one should treat NOTSET as None
URL: https://github.com/apache/airflow/pull/24787


-- 
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] dstandish commented on pull request #24787: Helper exactly_one should treat NOTSET as None

Posted by GitBox <gi...@apache.org>.
dstandish commented on PR #24787:
URL: https://github.com/apache/airflow/pull/24787#issuecomment-1172597934

   maybe not... will think more on 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] dstandish commented on pull request #24787: Helper exactly_one should treat NOTSET as None

Posted by GitBox <gi...@apache.org>.
dstandish commented on PR #24787:
URL: https://github.com/apache/airflow/pull/24787#issuecomment-1172604825

   yeah i guess i think it does make sense


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