Checking a Pandas pipeline before moving it to Polars
Описание и применение
Инструмент polars-ready сканирует исходный код Pandas, выявляя операции, требующие внимания при миграции в Polars, но не гарантирует корректность результата.
Задача
Existing Pandas pipelines often rely on implicit assumptions (index, row iteration, callbacks) that make direct migration to Polars risky.
Результат
polars-ready provides a source inventory of Pandas calls, highlighting those that require careful review before migration, but does not guarantee functional equivalence or performance gains.
Рабочий процесс
- 1. Install polars-ready via uvx from the GitHub repo
- 2. Run polars-ready on a Python file, notebook, or directory
- 3. The tool parses the source with the standard library AST without importing it
- 4. It reports each recognized Pandas operation, source line, category, and a suggested Polars idiom
- 5. Review the report to identify operations needing manual rewrite (e.g., index resampling)
- 6. Use the JSON output to integrate findings into a migration checklist or CI job
Доказательства
The CLI accepts a Python file, notebook, or directory. It parses source with the standard library AST and never imports the code it scans.
The report names each recognized operation, its source line, a rough category, and a suggested Polars idiom.
The scanner currently follows common Pandas import aliases and local variables assigned from recognized constructors or calls. It can miss a frame passed through another function or stored in a container.
- Дата записи: 2026-10-03T08:41:18.280Z