Skip to content

Comments

Use slicks for scanning and discovery#20

Merged
haoruizhou merged 14 commits intomainfrom
data-downloader-slicks-integration
Feb 18, 2026
Merged

Use slicks for scanning and discovery#20
haoruizhou merged 14 commits intomainfrom
data-downloader-slicks-integration

Conversation

@haoruizhou
Copy link
Collaborator

No description provided.

Ensure DATE_BIN uses a fixed origin (config.start) instead of the per-query t0 so bucket boundaries remain consistent across chunked/split queries. Adds a bin_origin variable and updates the SQL DATE_BIN(...) third argument to reference that origin, preventing misaligned bins when scanning runs in multiple segments.
Replace custom InfluxDB SQL scans with the slicks library: add slicks to requirements, delegate data-availability scanning to slicks.scan_data_availability and convert its ScanResult into the flat API dict format, and replace manual sensor SQL queries with slicks.discover_sensors (including fallback behavior). Update service connectivity check to use slicks.connect_influxdb3 / slicks.get_influx_client. Add docstrings and small refactors (private helper renames) while removing direct InfluxDBClient3 SQL query logic.
Handle Slack event errors
_build_sensor_fallback_range now finds the run with the longest duration and uses its time range for the fallback.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8569782d98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@haoruizhou haoruizhou force-pushed the data-downloader-slicks-integration branch from a6d3e1f to 62776dc Compare February 17, 2026 19:33
Add a simple HTML status page at / (app.py) that reports InfluxDB connectivity, runs, sensors and scanner status for quick debugging (imports HTMLResponse). Adjust periodic worker retry behavior to wait 60s after failures and keep the regular interval after successful scans (periodic_worker.py). Fix timezone handling in sensor discovery (sql.py) by converting UTC-aware datetimes to naive datetimes to work around slicks 0.1.3 generating invalid SQL for InfluxDB 3; apply same fix to fallback ranges. Add several debugging/reproduction scripts for inspecting slicks and InfluxDB behavior (installer/data-downloader/testing/*) to help reproduce timestamp/connection issues. Update docker-compose to inject INFLUX_URL, INFLUX_TOKEN and INFLUX_DB into the api and scanner services so slicks child processes can self-configure.
Introduce multi-season configuration and handling across the data-downloader service and frontend. Key changes:

- Config: add SeasonConfig and _parse_seasons to read SEASONS env var; expose seasons in Settings with sensible defaults.
- Backend services: manage per-season Runs/Sensors repositories (file suffixing), return seasons list via /api/seasons, accept optional season parameter for runs/sensors/note/query endpoints, scan all configured seasons and store results per-season, and default to newest season when none provided.
- Influx/query: fetch_signal_series now accepts a database override and service query routes pass season-specific DBs.
- Scanner/Storage: adjust season start/end boundaries (season starts Aug previous year, ends Jan 1 next year); storage filenames include season suffix.
- Periodic worker: support scheduling either by interval or daily time via SCAN_DAILY_TIME env var.
- Frontend: fetch seasons, add season selector UI, propagate selected season to all API calls and adapt visuals (accent color), and add season type to types.
- Docker compose: add SEASONS and SCAN_DAILY_TIME environment wiring and minor formatting fixes.
- .gitignore: ignore installer/data-downloader/data.

Fallbacks and defaults are provided when SEASONS is unset, and scanning continues per-season even if individual season scans fail.
@haoruizhou haoruizhou force-pushed the main branch 2 times, most recently from fc33293 to bedc080 Compare February 17, 2026 23:05
@haoruizhou haoruizhou force-pushed the data-downloader-slicks-integration branch from b76ea2e to 93c6d7d Compare February 17, 2026 23:19
@haoruizhou haoruizhou force-pushed the data-downloader-slicks-integration branch from eb5b063 to 14b610d Compare February 18, 2026 01:06
Handle config.table values that may include a schema (e.g. "iox.WFR25"). server_scanner.scan_runs now splits config.table into schema and table_name and passes them to slicks.connect_influxdb3; it also sets the local table variable to None to rely on the global configuration. sql.fetch_unique_sensors now includes schema and table when connecting as well. These changes ensure the DB connector receives explicit schema/table info and that scanning functions behave correctly when config.table is provided as "schema.table".
@haoruizhou haoruizhou merged commit 2111985 into main Feb 18, 2026
12 of 14 checks passed
@haoruizhou haoruizhou deleted the data-downloader-slicks-integration branch February 18, 2026 01:41
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