Skip to content

fix(etl): guard daily_diffs schema on Postgres#737

Merged
stranske merged 4 commits intomainfrom
codex/mopup-daily-diff-postgres-guard
Mar 2, 2026
Merged

fix(etl): guard daily_diffs schema on Postgres#737
stranske merged 4 commits intomainfrom
codex/mopup-daily-diff-postgres-guard

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Mar 2, 2026

Summary

  • fail fast in daily_diff_flow when daily_diffs is missing on Postgres, instead of executing SQLite-only assumptions later in the flow
  • keep SQLite behavior unchanged (create table on demand for local/test use)
  • add regression assertions that Postgres path does not emit SQLite DDL

Testing

  • pytest -q tests/test_daily_diff.py

Copilot AI review requested due to automatic review settings March 2, 2026 03:46
@agents-workflows-bot
Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #737. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

@stranske-keepalive
Copy link
Copy Markdown
Contributor

stranske-keepalive bot commented Mar 2, 2026

🤖 Keepalive Loop Status

PR #737 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate success
Tasks 0/4 complete
Timeout 45 min (default)
Timeout usage 2m elapsed (5%, 43m remaining)
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

@stranske-keepalive
Copy link
Copy Markdown
Contributor

stranske-keepalive bot commented Mar 2, 2026

Keepalive Work Log (click to expand)
# Time (UTC) Agent Action Result Files Tasks Progress Commit Gate
0 2026-03-02 03:49:22 Codex wait (missing-agent-label-transient) skipped 0 0/4 success
0 2026-03-02 04:18:13 Codex wait (missing-agent-label-transient) skipped 0 0/4 success
0 2026-03-02 04:31:44 Codex wait (missing-agent-label-transient) skipped 0 0/4 success
0 2026-03-02 04:34:13 Codex wait (missing-agent-label-transient) skipped 0 0/4 success

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the daily diff ETL flow to avoid running SQLite-only DDL against Postgres by validating the daily_diffs table early, while preserving the existing “create on demand” behavior for SQLite dev/test runs.

Changes:

  • Updated _ensure_daily_diffs_table() to create daily_diffs only for SQLite and to fail fast on non-SQLite connections.
  • Added regression assertions to ensure the Postgres path does not emit SQLite-specific DDL (e.g., AUTOINCREMENT, CREATE TABLE IF NOT EXISTS).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
etl/daily_diff_flow.py Adds Postgres-side existence check for daily_diffs and keeps SQLite table creation behavior.
tests/test_daily_diff.py Strengthens the Postgres-flow test to assert the new guard query runs and SQLite DDL is not emitted.

stranske and others added 3 commits March 1, 2026 22:15
@stranske stranske merged commit 955b48a into main Mar 2, 2026
33 checks passed
@stranske stranske deleted the codex/mopup-daily-diff-postgres-guard branch March 2, 2026 04:36
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.

2 participants