Skip to content

F823 false positive in ruff 0.0.283 #6433

@harupy

Description

@harupy

Command to reproduce

docker run --rm python:3.8 bash -c "git clone --depth=1 https://github.com/mlflow/mlflow.git && cd mlflow && pip install ruff && ruff --show-source --select F823 ."

Result

tests/sklearn/test_sklearn_autolog.py:1464:5: F823 Local variable `sklearn` referenced before assignment
     |
1462 |     import sklearn.linear_model
1463 | 
1464 |     mlflow.sklearn.autolog()
     |     ^^^^^^ F823
1465 |     from sklearn.metrics import roc_auc_score
     |

tests/sklearn/test_sklearn_autolog.py:1777:5: F823 Local variable `sklearn` referenced before assignment
     |
1776 | def test_autolog_pos_label_used_for_training_metric():
1777 |     mlflow.sklearn.autolog(pos_label=1)
     |     ^^^^^^ F823
1778 | 
1779 |     import sklearn.ensemble
     |

Found 2 errors.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions