Skip to content

chore(local-testing): keep race and session pickers error-free when empty - #371

Merged
bkonick merged 1 commit into
mainfrom
fix-empty-picker-errors
Nov 1, 2026
Merged

bkonick merged 1 commit into
mainfrom
fix-empty-picker-errors

Conversation

@bkonick

@bkonick bkonick commented Nov 1, 2026

Copy link
Copy Markdown
Member

Summary

The Race picker (Laps and Race Control) and the Session picker (Laps) show an error icon whenever their query returns no rows, e.g. on a fresh local stack with an empty races table, or when no race is selected.

A Postgres variable query with zero rows reaches Grafana as a frame with no fields, and Grafana 13's variable code throws Couldn't find any field of type string in the results. on it. Both queries now return a single ('', 'None') placeholder row only when there is nothing else to list; populated lists are unchanged. Panels already match nothing for an empty race/session, so the placeholder doesn't change what they render.

Testing

  • New DB-backed tests in tests/test_dashboards.py cover the empty and populated cases for both pickers (empty cases failed before the change).
  • Full suite against a throwaway Postgres: 1364 passed; ruff clean.
  • Ran the new queries through the local Grafana's /api/ds/query against the empty DB: both return typed __value/__text string fields with the None row.

🤖 Generated with Claude Code

…mpty

A Postgres variable query that returns zero rows reaches Grafana as a frame
with no fields, and Grafana's variable code throws "Couldn't find any field
of type string in the results." on it. Return a ('', 'None') placeholder row
when there are no races, or no sessions for the selected race.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1
  • ai-review

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.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0d4570f5-4a6b-4197-989c-1c2c71cc4828

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

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@bkonick
bkonick merged commit 357916f into main Nov 1, 2026
8 checks passed
@bkonick
bkonick deleted the fix-empty-picker-errors branch November 1, 2026 16:00
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