Skip to content

feat: Phase 3 - Query layer Polars support + benchmarks #1047

Draft
EngCaioFonseca wants to merge 1 commit intopolars/phase-1-setup-and-pilotfrom
polars/phase-2-query-layer
Draft

feat: Phase 3 - Query layer Polars support + benchmarks #1047
EngCaioFonseca wants to merge 1 commit intopolars/phase-1-setup-and-pilotfrom
polars/phase-2-query-layer

Conversation

@EngCaioFonseca
Copy link
Copy Markdown
Contributor

PR of the series of migrating pandas to polars in 8knot.

Generative AI disclosure

  • This contribution was assisted or created by Generative AI tools.
    • What tools were used?
    • How were these tools used?
    • Did you review these outputs before submitting this PR?

…sions

Phase 3 - Query Layer:
- Add Polars support to cache_facade.py:
  - retrieve_from_cache() now accepts as_polars=True for Polars output
  - New retrieve_from_cache_polars() convenience function
  - Direct Polars DataFrame creation from cursor results

Performance Benchmarks:
- Add benchmarks/polars_benchmark.py with comprehensive tests:
  - DataFrame creation comparison
  - GroupBy aggregation
  - Filter + Sort operations
  - Conditional column creation
  - Vectorized log calculations
  - Cumsum threshold finding
  - Open items counting

More Module Conversions (Phase 2 continued):
- contrib_importance_over_time.py:
  - Polars for initial datetime processing
  - Polars groupby + pivot in cntrb_prolificacy_over_time()
  - Replaced .apply() loop with list comprehension
- issues_over_time.py:
  - Polars for datetime conversion and sorting
  - Vectorized open count with get_open_vectorized()
- pr_over_time.py:
  - Polars for datetime conversion and sorting
  - Vectorized open count with get_open_vectorized()

Total modules using Polars: 6+ (repo_general_info, code_languages,
ossf_scorecard, contrib_importance_over_time, issues_over_time, pr_over_time)

Architecture maintained: Polars Core, Pandas Edge
@EngCaioFonseca EngCaioFonseca self-assigned this Dec 19, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 19, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch polars/phase-2-query-layer

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EngCaioFonseca EngCaioFonseca moved this from Backlog to In Progress in Aspen Project Board Jan 26, 2026
@EngCaioFonseca EngCaioFonseca moved this from In Progress to "On Deck" in Aspen Project Board Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: "On Deck"

Development

Successfully merging this pull request may close these issues.

1 participant