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

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