khalidmammadov opened a new pull request #18590:
URL: https://github.com/apache/airflow/pull/18590
This PR fixes a bug when "roles" dictionary key is checked for none
existence and provides false positive when field does exist and is an empty
array.
e.g. given below dictionary
```
d=dict(role=[])
if d.get('role'): # will yield False!!!
do_something
```
but
```
if 'role' in d: # is True
do_something
```
will provide true
I also renamed **users_list** variable names to **users_list_** as there is
a function with the same name **users_list** in the module. This can help to
avoid possible future issues.
This PR also fixes below flaky test:
tests/cli/commands/test_user_command.py::TestCliUsers::test_find_user_exceptions
---
**^ 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]