bito-code-review[bot] commented on PR #40738:
URL: https://github.com/apache/superset/pull/40738#issuecomment-4633881231
<!-- Bito Reply -->
The reviewer is correct. Using exact equality (`==`) for floating-point
values in tests can lead to intermittent failures due to precision differences.
You should replace these assertions with `np.isclose` to ensure robust
comparisons, consistent with the approach used elsewhere in the file.
Here is the suggested update for the affected lines in
`tests/unit_tests/pandas_postprocessing/test_rank.py`:
```python
assert np.isclose(tmp_df["rank"].min(), 1.0 / len(tmp_df), rtol=1e-8)
assert np.isclose(tmp_df["rank"].max(), 1.0, rtol=1e-8)
```
**tests/unit_tests/pandas_postprocessing/test_rank.py**
```
assert np.isclose(tmp_df["rank"].min(), 1.0 / len(tmp_df), rtol=1e-8)
assert np.isclose(tmp_df["rank"].max(), 1.0, rtol=1e-8)
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]