Skip to content

feat: add last query#1682

Merged
SAKURA-CAT merged 17 commits into
mainfrom
fix/metrics-with-last
Jun 11, 2026
Merged

feat: add last query#1682
SAKURA-CAT merged 17 commits into
mainfrom
fix/metrics-with-last

Conversation

@Nexisato

@Nexisato Nexisato commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Description

  • add last time range query

TODO: skills & docs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request translates docstrings from Chinese to English across several SwanLab API files and introduces a new last parameter to the RangeQuery model to filter scalar metrics by a recent time window (in milliseconds). The CSV streaming parser is updated to support this filtering mode, and validation is added to ensure last is mutually exclusive with start and end parameters. There are no review comments, so no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Nexisato Nexisato self-assigned this Jun 10, 2026
@Nexisato

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request increases the default pagination page size from 20 to 100 across various API endpoints, translates and expands several docstrings to English, and removes the artificial random sleep from the pagination helper. It also refactors metric fetching by introducing concurrent batching and CSV downloading via a thread pool, and updates the CLI commands to utilize these new classes. A critical logical issue was identified in swanlab/api/column.py where the auto-pagination query fails to set all=False when filters are present, which would cause the backend to ignore the filters; a code suggestion has been provided to fix this.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread swanlab/api/column.py Outdated
@Nexisato

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request increases the default pagination page size from 20 to 100 across several API endpoints, updates and translates docstrings to English, and removes the artificial sleep delay in pagination. It also refactors the metrics querying system to support batching, concurrency, and caching, and introduces a new last parameter to RangeQuery for filtering metrics by a recent time window. In the CLI, commands are updated to use the new Metrics and Summary classes, and redundant checks are cleaned up. The review feedback suggests tracking whether a warning about a missing timestamp column has already been logged during CSV parsing to prevent console flooding and performance degradation on large files.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread swanlab/api/metric.py
Comment thread swanlab/api/metric.py Outdated
@Nexisato Nexisato added the 🔌 api SwanLab OpenAPI label Jun 11, 2026
@Nexisato Nexisato requested a review from SAKURA-CAT June 11, 2026 09:09
@SAKURA-CAT SAKURA-CAT merged commit 55a8c23 into main Jun 11, 2026
19 checks passed
@SAKURA-CAT SAKURA-CAT deleted the fix/metrics-with-last branch June 11, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔌 api SwanLab OpenAPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants