Skip to content

Conversation

@vistart
Copy link
Contributor

@vistart vistart commented Mar 28, 2025

Overview

This PR enhances our query capabilities by implementing window functions, advanced grouping models (CUBE, ROLLUP, and GROUPING SETS), and improving JSON test support. It also includes several refactoring changes to improve code clarity and consistency.

Changes

New Features

  • Added comprehensive support for window functions with frame specifications
  • Implemented test cases for both bounded and unbounded window frames
  • Added utility functions for JSON test fixtures
  • Implemented advanced grouping models (CUBE, ROLLUP, and GROUPING SETS)

Refactoring

  • Renamed simple aggregate methods to "scalar" for better clarity
  • Simplified window function definitions by removing unnecessary identifier formatting
  • Standardized order direction in window function implementations
  • Translated model and test docstrings to English for consistency
  • Enhanced group column selection by checking for existing expressions
  • Renamed test_json_expressions.py and updated import paths
  • Replaced query.all() with query.aggregate() for JSON tests

Testing

  • Added comprehensive test coverage for all new features
  • Updated database configurations for more robust testing

Motivation

These changes provide more powerful querying capabilities while making the codebase more maintainable and consistent. The window functions allow for complex analytical queries, while the advanced grouping models enable more sophisticated data aggregation scenarios.

Impact

This PR significantly enhances our data analysis capabilities without breaking existing functionality. The refactoring changes improve code readability and maintainability while ensuring consistent naming and documentation across the codebase.

vistart added 9 commits March 25, 2025 11:00
- Add test cases for window functions with frame specifications
- Add test cases for unbounded window frames
- Add utility functions for JSON test fixtures
- Add MySQL version detection helper function
- Update database configurations for testing
…y identifier formatting and standardizing order direction
Enhance group column selection by checking for existing expressions
…place query.all() with query.aggregate() for JSON tests
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4.0% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

Attention: Patch coverage is 67.51701% with 191 lines in your changes missing coverage. Please review.

Project coverage is 79.28%. Comparing base (eceb40c) to head (adbf0b2).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...social/activerecord/backend/impl/sqlite/dialect.py 29.24% 74 Missing and 1 partial ⚠️
src/rhosocial/activerecord/query/expression.py 74.83% 29 Missing and 9 partials ⚠️
src/rhosocial/activerecord/query/aggregate.py 77.86% 17 Missing and 10 partials ⚠️
src/rhosocial/activerecord/query/base.py 79.20% 14 Missing and 7 partials ⚠️
src/rhosocial/activerecord/backend/dialect.py 68.00% 16 Missing ⚠️
...social/activerecord/backend/impl/sqlite/backend.py 50.00% 12 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #6      +/-   ##
==========================================
- Coverage   79.56%   79.28%   -0.28%     
==========================================
  Files          41       41              
  Lines        3181     3708     +527     
  Branches      463      621     +158     
==========================================
+ Hits         2531     2940     +409     
- Misses        483      576      +93     
- Partials      167      192      +25     
Flag Coverage Δ
python-3.10 78.91% <67.51%> (-0.53%) ⬇️
python-3.11 78.91% <67.51%> (-0.53%) ⬇️
python-3.12 78.91% <67.51%> (-0.53%) ⬇️
python-3.13 78.91% <67.51%> (-0.53%) ⬇️
python-3.8 79.16% <67.51%> (?)
python-3.9 78.97% <67.51%> (-0.55%) ⬇️
unittests 79.23% <67.51%> (-0.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vistart vistart merged commit 7484576 into main Mar 28, 2025
6 of 9 checks passed
@vistart vistart deleted the aggregate branch March 31, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant