---
source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs
---
<filename>:7:5: TCH002 [*] Move third-party import `pandas.DataFrame` into a type-checking block
  |
6 | from pandas import (
7 |     DataFrame,  # DataFrame
  |     ^^^^^^^^^ TCH002
8 |     Series,  # Series
9 | )
  |
  = help: Move into type-checking block

ℹ Unsafe fix
3  3  | 
4  4  | from typing import TYPE_CHECKING
5  5  | 
6     |-from pandas import (
7     |-    DataFrame,  # DataFrame
8     |-    Series,  # Series
9     |-)
10 6  | 
   7  |+if TYPE_CHECKING:
   8  |+    from pandas import (
   9  |+        DataFrame,  # DataFrame
   10 |+        Series,  # Series
   11 |+    )
   12 |+
11 13 | def f(x: DataFrame, y: Series):
12 14 |     pass

<filename>:8:5: TCH002 [*] Move third-party import `pandas.Series` into a type-checking block
  |
6 | from pandas import (
7 |     DataFrame,  # DataFrame
8 |     Series,  # Series
  |     ^^^^^^ TCH002
9 | )
  |
  = help: Move into type-checking block

ℹ Unsafe fix
3  3  | 
4  4  | from typing import TYPE_CHECKING
5  5  | 
6     |-from pandas import (
7     |-    DataFrame,  # DataFrame
8     |-    Series,  # Series
9     |-)
10 6  | 
   7  |+if TYPE_CHECKING:
   8  |+    from pandas import (
   9  |+        DataFrame,  # DataFrame
   10 |+        Series,  # Series
   11 |+    )
   12 |+
11 13 | def f(x: DataFrame, y: Series):
12 14 |     pass


