uranusjr commented on code in PR #33227:
URL: https://github.com/apache/airflow/pull/33227#discussion_r1292996329
##########
airflow/providers/apache/livy/hooks/livy.py:
##########
@@ -448,7 +448,7 @@ def _validate_extra_conf(conf: dict[Any, Any]) -> bool:
if conf:
if not isinstance(conf, dict):
raise ValueError("'conf' argument must be a dict")
- if any(True for k, v in conf.items() if not (v and isinstance(v,
str) or isinstance(v, int))):
+ if not all(v and isinstance(v, str) or isinstance(v, int) for v in
conf.values()):
Review Comment:
Oh because operation precedence. Maybe add paranthese to make it more
obvious?
```python
not (isinstance(v, int) or (isinstance(v, str) and v))
```
(I’m not quite sure why this needs to check for empty string in the first
place but maybe Livy has some special rules.)
--
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]