diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9e48ab9b6189..1065ccff32632 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,9 +66,17 @@ repos: from\ pandas\.core\ import\ common| # Check for imports from collections.abc instead of `from collections import abc` - from\ collections\.abc\ import| + from\ collections\.abc\ import - from\ numpy\ import\ nan + - id: non-standard-numpy.random-related-imports + name: Check for non-standard numpy.random-related imports excluding pandas/_testing.py + language: pygrep + exclude: pandas/_testing.py + entry: | + (?x) + # Check for imports from np.random. instead of `from numpy import random` or `from numpy.random import ` + from\ numpy\ import\ random| + from\ numpy.random\ import types: [python] - id: non-standard-imports-in-tests name: Check for non-standard imports in test suite