Polars/phase 1 setup and pilot#1046
Draft
EngCaioFonseca wants to merge 2 commits intopolars/phase-0-anti-patternsfrom
Draft
Polars/phase 1 setup and pilot#1046EngCaioFonseca wants to merge 2 commits intopolars/phase-0-anti-patternsfrom
EngCaioFonseca wants to merge 2 commits intopolars/phase-0-anti-patternsfrom
Conversation
Phase 1 - Preparation: - Add polars~=1.30 to pyproject.toml - Create polars_utils.py adapter layer with: - to_polars(): Pandas -> Polars conversion - to_pandas(): Polars -> Pandas conversion - process_with_polars(): Auto-wrap for Polars processing - lazy_process(): Lazy evaluation wrapper - Expressions class: Common reusable expressions Phase 2 - Pilot Conversion: - Convert repo_general_info.py to use 'Polars Core, Pandas Edge' pattern - All data processing now uses Polars expressions - Converts to Pandas only at visualization boundary - Uses pl.col(), .with_columns(), .filter(), .select() - Demonstrates the migration pattern for other modules Architecture pattern established: Database -> Polars (fast) -> Pandas (Plotly/Dash boundary) Next: Apply same pattern to remaining visualization modules
Continue Phase 2 - Converting repo_overview visualizations: code_languages.py: - SVG line count fix using pl.when().then().otherwise() - Language grouping with threshold using Polars expressions - Aggregation using group_by().agg() - Percentage calculations with Polars ossf_scorecard.py: - Extract process_data() function for clean separation - Date handling with Polars datetime - Column renaming with pl.when() for conditional logic - Sort and rename operations in Polars Pattern: All data processing in Polars, to_pandas() only at visualization boundary 3 of ~40 visualization modules now use Polars core processing
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR of the series of migrating pandas to polars in 8knot
Generative AI disclosure