Use ruff to enforce import alias #57282
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I replaced the hook
use-pd_array-in-core
withruff
'sunconventional-import-alias
The
pre-commit
job will fail to show that the check works. It will pass after I enableexclude: ^pandas/core/api\.py$
.If this change is accepted, I can continue with removing the old hook.
As far as I can understand, a major difference is that
scripts/use_pd_array_in_core.py
tries to detect all variants ofpd.<insert anything here>.array
while we must explicitly pass the full path forruff
(there's onlypandas.core.construction.array
).