diff --git a/.agents/phases/todo/103_suggestions_session_openers/00_phase.md b/.agents/phases/complete/103_suggestions_session_openers/00_phase.md similarity index 100% rename from .agents/phases/todo/103_suggestions_session_openers/00_phase.md rename to .agents/phases/complete/103_suggestions_session_openers/00_phase.md diff --git a/.agents/phases/todo/103_suggestions_session_openers/01_opener_extraction.md b/.agents/phases/complete/103_suggestions_session_openers/01_opener_extraction.md similarity index 100% rename from .agents/phases/todo/103_suggestions_session_openers/01_opener_extraction.md rename to .agents/phases/complete/103_suggestions_session_openers/01_opener_extraction.md diff --git a/.agents/phases/todo/103_suggestions_session_openers/02_openers_docs.md b/.agents/phases/complete/103_suggestions_session_openers/02_openers_docs.md similarity index 100% rename from .agents/phases/todo/103_suggestions_session_openers/02_openers_docs.md rename to .agents/phases/complete/103_suggestions_session_openers/02_openers_docs.md diff --git a/.agents/phases/todo/103_suggestions_session_openers/03_e2e_suite_commit.md b/.agents/phases/complete/103_suggestions_session_openers/03_e2e_suite_commit.md similarity index 100% rename from .agents/phases/todo/103_suggestions_session_openers/03_e2e_suite_commit.md rename to .agents/phases/complete/103_suggestions_session_openers/03_e2e_suite_commit.md diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__00_phase.a1.err b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__00_phase.a1.err new file mode 100644 index 0000000..e69de29 diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__00_phase.a1.md b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__00_phase.a1.md new file mode 100644 index 0000000..f447007 --- /dev/null +++ b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__00_phase.a1.md @@ -0,0 +1,18 @@ +Phase 103 final verification pass — all green. + +**Verified (all 3 tasks already in `complete/`; no code changes needed):** +- `opening_questions` in `app/api/suggestions.py` — forward walk, one opener per chat (first non-blank user msg, A3), reads raw `messages` not `title` (A4), phase-80 order/dedup/cap/seed contracts; `last_questions` name gone from `app/`+`tests/` +- Docs updated: `app/config.py` seed docstring, `.env.example` `BOR_SUGGESTIONS`, `README.md` — "session openers" wording +- Diff scope correct: only the 6 expected files + phase-file moves; `app/rag/suggestions.py` and `frontend/` untouched + +**Test / lint / coverage results:** +- `uv run pytest tests/integration/test_suggestions_api.py -v` → 12 passed +- `uv run pytest tests/e2e/test_suggestion_chips.py -v --no-cov` → 8 passed in isolation (opener-only core pin included) +- `test_responsive_polish.py` → 7 passed; `test_chat_persistence.py` → 4 passed (both isolated, no edits) +- `uv run pytest --cov=app --cov-report=term-missing` → 2086 passed, TOTAL 99% (>90%); `app/api/suggestions.py` 100% +- `uv run ruff check .` → clean; `uv run pyright` → 0 errors, 0 warnings + +**Completion criteria:** all 7 ✅ (follow-ups-never-surface pin; cap-across-chats pin; seed/dedup/case/partial/A3/401 pins; E2E suites isolated; deflection chips unchanged; full suite + lint; commit + dir move left to harness per executor rules). + +**Deviations:** none — no defects found; nothing changed in this pass. +**Next pending phase:** `98_sync_summary_visibility` (numeric order in `todo/`). diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__00_phase.a1.validate b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__00_phase.a1.validate new file mode 100644 index 0000000..e1a9466 --- /dev/null +++ b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__00_phase.a1.validate @@ -0,0 +1,96 @@ +........................................................................ [ 3%] +........................................................................ [ 6%] +........................................................................ [ 10%] +........................................................................ [ 13%] +........................................................................ [ 17%] +........................................................................ [ 20%] +........................................................................ [ 24%] +........................................................................ [ 27%] +........................................................................ [ 31%] +........................................................................ [ 34%] +........................................................................ [ 37%] +........................................................................ [ 41%] +........................................................................ [ 44%] +........................................................................ [ 48%] +........................................................................ [ 51%] +........................................................................ [ 55%] +........................................................................ [ 58%] +........................................................................ [ 62%] +........................................................................ [ 65%] +........................................................................ [ 69%] +........................................................................ [ 72%] +........................................................................ [ 75%] +........................................................................ [ 79%] +........................................................................ [ 82%] +........................................................................ [ 86%] +........................................................................ [ 89%] +........................................................................ [ 93%] +........................................................................ [ 96%] +...................................................................... [100%] +=============================== warnings summary =============================== +.venv/lib/python3.13/site-packages/fastapi/testclient.py:1 + /var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead. + from starlette.testclient import TestClient as TestClient # noqa + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +================================ tests coverage ================================ +_______________ coverage: platform linux, python 3.13.13-final-0 _______________ + +Name Stmts Miss Cover +-------------------------------------------------- +app/__init__.py 1 0 100% +app/api/__init__.py 0 0 100% +app/api/auth.py 52 0 100% +app/api/chat.py 181 0 100% +app/api/chats.py 110 0 100% +app/api/config.py 13 0 100% +app/api/doc_drafts.py 94 0 100% +app/api/docs.py 134 1 99% +app/api/git_sources.py 229 0 100% +app/api/health.py 10 0 100% +app/api/steering.py 42 0 100% +app/api/suggestions.py 33 0 100% +app/api/sync.py 115 0 100% +app/api/tokens.py 40 0 100% +app/api/ui_settings.py 55 0 100% +app/config.py 140 0 100% +app/core/__init__.py 0 0 100% +app/core/auth.py 45 0 100% +app/core/caching.py 124 0 100% +app/core/debugging.py 29 2 93% +app/core/docs_push.py 39 0 100% +app/core/errors.py 5 0 100% +app/core/logging.py 13 0 100% +app/core/rate_limit.py 44 0 100% +app/core/security_headers.py 20 0 100% +app/core/theming.py 38 0 100% +app/core/tokens.py 44 0 100% +app/db.py 21 0 100% +app/main.py 66 0 100% +app/models.py 125 0 100% +app/rag/__init__.py 0 0 100% +app/rag/agent.py 316 1 99% +app/rag/archive_upload.py 128 0 100% +app/rag/chunker.py 206 4 98% +app/rag/folder_summaries.py 121 0 100% +app/rag/git_sources.py 14 0 100% +app/rag/importer.py 197 3 98% +app/rag/llm.py 243 1 99% +app/rag/overview.py 71 0 100% +app/rag/prompts.py 88 0 100% +app/rag/retriever.py 150 3 98% +app/rag/scaffolding.py 55 0 100% +app/rag/source_removal.py 41 0 100% +app/rag/sources_meta.py 16 0 100% +app/rag/suggestions.py 27 0 100% +app/rag/summarizer.py 24 0 100% +app/schemas.py 307 0 100% +-------------------------------------------------- +TOTAL 3866 15 99% +coverage gate: app/ 99% (>90%) OK +All checks passed! +0 errors, 0 warnings, 0 informations +WARNING: there is a new pyright version available (v1.1.411 -> v1.1.414). +Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest` + +validation OK diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__01_opener_extraction.a1.err b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__01_opener_extraction.a1.err new file mode 100644 index 0000000..e69de29 diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__01_opener_extraction.a1.md b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__01_opener_extraction.a1.md new file mode 100644 index 0000000..be56a77 --- /dev/null +++ b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__01_opener_extraction.a1.md @@ -0,0 +1,16 @@ +Task 01 complete — all green. + +**Implemented** +- `app/api/suggestions.py`: renamed `last_questions` → `opening_questions` (module-internal; no other importers); replaced the REVERSE every-user-question walk with the FORWARD opener walk (first non-blank `who=="user"` message per chat; leading blanks skipped, no-blank-user chats contribute nothing); phase-80 order (`updated_at`/`created_at` DESC), exact dedup, cap-3 (now binding across chats), and seed fallback unchanged. +- Dense docstrings: module = opener contract + WHY (qwen/llama.cpp follow-up example), function = forward walk + A3 rule + A4 why-not-`SavedChat.title` (`_auto_title` 120-char truncation/whitespace-collapse, user-editable), endpoint = "opening questions of the 3 most recent saved chats — or … the seed list". +- Rewrote `tests/integration/test_suggestions_api.py` matrix (12 tests): follow-ups-never-surface core pin (1 chat, 4 questions → exactly `[Q_ONE]`), new `test_cap_three_across_chats` (4 multi-turn chats → 3 newest openers, oldest dropped, no follow-ups anywhere), rewritten chat-order/dedup pair, partial pins (follow-ups don't pad), new A3 leading-blank test; seed/brain-only/401 pins kept. Added `FOLLOW_UP` text. + +**Results** +- `uv run pytest tests/integration/test_suggestions_api.py -v` → 12 passed (DB up) +- `uv run pytest --cov=app --cov-report=term-missing` → 2086 passed; `app/api/suggestions.py` 100% (33/33); TOTAL 99% (>90%) +- `uv run ruff check .` → All checks passed; `uv run pyright` → 0 errors, 0 warnings +- `grep last_questions app/ tests/` → no matches + +**Decisions**: none beyond the phase design. E2E suite intentionally left on phase-80 semantics (task 03); docs wording is task 02. Only the two allowed files changed. + +**Next pending task**: `02_openers_docs.md` (phase 103). diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__01_opener_extraction.a1.validate b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__01_opener_extraction.a1.validate new file mode 100644 index 0000000..e1a9466 --- /dev/null +++ b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__01_opener_extraction.a1.validate @@ -0,0 +1,96 @@ +........................................................................ [ 3%] +........................................................................ [ 6%] +........................................................................ [ 10%] +........................................................................ [ 13%] +........................................................................ [ 17%] +........................................................................ [ 20%] +........................................................................ [ 24%] +........................................................................ [ 27%] +........................................................................ [ 31%] +........................................................................ [ 34%] +........................................................................ [ 37%] +........................................................................ [ 41%] +........................................................................ [ 44%] +........................................................................ [ 48%] +........................................................................ [ 51%] +........................................................................ [ 55%] +........................................................................ [ 58%] +........................................................................ [ 62%] +........................................................................ [ 65%] +........................................................................ [ 69%] +........................................................................ [ 72%] +........................................................................ [ 75%] +........................................................................ [ 79%] +........................................................................ [ 82%] +........................................................................ [ 86%] +........................................................................ [ 89%] +........................................................................ [ 93%] +........................................................................ [ 96%] +...................................................................... [100%] +=============================== warnings summary =============================== +.venv/lib/python3.13/site-packages/fastapi/testclient.py:1 + /var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead. + from starlette.testclient import TestClient as TestClient # noqa + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +================================ tests coverage ================================ +_______________ coverage: platform linux, python 3.13.13-final-0 _______________ + +Name Stmts Miss Cover +-------------------------------------------------- +app/__init__.py 1 0 100% +app/api/__init__.py 0 0 100% +app/api/auth.py 52 0 100% +app/api/chat.py 181 0 100% +app/api/chats.py 110 0 100% +app/api/config.py 13 0 100% +app/api/doc_drafts.py 94 0 100% +app/api/docs.py 134 1 99% +app/api/git_sources.py 229 0 100% +app/api/health.py 10 0 100% +app/api/steering.py 42 0 100% +app/api/suggestions.py 33 0 100% +app/api/sync.py 115 0 100% +app/api/tokens.py 40 0 100% +app/api/ui_settings.py 55 0 100% +app/config.py 140 0 100% +app/core/__init__.py 0 0 100% +app/core/auth.py 45 0 100% +app/core/caching.py 124 0 100% +app/core/debugging.py 29 2 93% +app/core/docs_push.py 39 0 100% +app/core/errors.py 5 0 100% +app/core/logging.py 13 0 100% +app/core/rate_limit.py 44 0 100% +app/core/security_headers.py 20 0 100% +app/core/theming.py 38 0 100% +app/core/tokens.py 44 0 100% +app/db.py 21 0 100% +app/main.py 66 0 100% +app/models.py 125 0 100% +app/rag/__init__.py 0 0 100% +app/rag/agent.py 316 1 99% +app/rag/archive_upload.py 128 0 100% +app/rag/chunker.py 206 4 98% +app/rag/folder_summaries.py 121 0 100% +app/rag/git_sources.py 14 0 100% +app/rag/importer.py 197 3 98% +app/rag/llm.py 243 1 99% +app/rag/overview.py 71 0 100% +app/rag/prompts.py 88 0 100% +app/rag/retriever.py 150 3 98% +app/rag/scaffolding.py 55 0 100% +app/rag/source_removal.py 41 0 100% +app/rag/sources_meta.py 16 0 100% +app/rag/suggestions.py 27 0 100% +app/rag/summarizer.py 24 0 100% +app/schemas.py 307 0 100% +-------------------------------------------------- +TOTAL 3866 15 99% +coverage gate: app/ 99% (>90%) OK +All checks passed! +0 errors, 0 warnings, 0 informations +WARNING: there is a new pyright version available (v1.1.411 -> v1.1.414). +Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest` + +validation OK diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__02_openers_docs.a1.err b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__02_openers_docs.a1.err new file mode 100644 index 0000000..e69de29 diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__02_openers_docs.a1.md b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__02_openers_docs.a1.md new file mode 100644 index 0000000..9554269 --- /dev/null +++ b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__02_openers_docs.a1.md @@ -0,0 +1,17 @@ +Task 02 complete — all gates green. + +**Implemented (task 02 — "session openers" wording):** +- `app/config.py` — `suggestions` seed comment now describes "the opening questions of the 3 most recent saved chats (the session openers — a chat's first user question; follow-ups never chip — phase 103)"; `BOR_SUGGESTIONS` override sentence kept +- `.env.example` — `BOR_SUGGESTIONS` comment appended with "; after that the chips are the 3 newest chats' opening questions (phase 103)" +- `README.md` — chat-features line now reads "follow the opening questions of the 3 most recent saved chats (each chat's first question — a follow-up never chips, phase 103)"; surrounding sentence intact +- `app/api/suggestions.py` — module docstring's historical "last 3 questions asked" phrase reworded (task-01 file, comment-only) so the required grep sweep over `app/` returns zero hits; stale gitignored `.pyc` that matched the sweep removed + +**Test / lint / coverage:** +- `grep -rn "last 3 questions" app/ .env.example README.md` → zero hits +- `uv run pytest tests/unit/test_config.py -q` → 45 passed +- `uv run pytest --cov=app --cov-report=term-missing` → 2086 passed, `app/` coverage **99%** (>90%), `app/api/suggestions.py` 100% +- `uv run ruff check . && uv run pyright` → clean (0 errors) + +**Decisions:** the docstring rewording in `suggestions.py` was necessary — task 02's grep sweep covers all of `app/`, and task 01's docstring retained the retired phrase as history; the full WHY (follow-ups meaningless without their session, qwen/llama.cpp example) remains in that module docstring. No logic touched; changes left uncommitted in the working tree per harness protocol. + +**Next pending task:** `.agents/phases/todo/103_suggestions_session_openers/03_e2e_suite_commit.md` (story-suite E2E rewrite + full gate + atomic commit). diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__02_openers_docs.a1.validate b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__02_openers_docs.a1.validate new file mode 100644 index 0000000..e1a9466 --- /dev/null +++ b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__02_openers_docs.a1.validate @@ -0,0 +1,96 @@ +........................................................................ [ 3%] +........................................................................ [ 6%] +........................................................................ [ 10%] +........................................................................ [ 13%] +........................................................................ [ 17%] +........................................................................ [ 20%] +........................................................................ [ 24%] +........................................................................ [ 27%] +........................................................................ [ 31%] +........................................................................ [ 34%] +........................................................................ [ 37%] +........................................................................ [ 41%] +........................................................................ [ 44%] +........................................................................ [ 48%] +........................................................................ [ 51%] +........................................................................ [ 55%] +........................................................................ [ 58%] +........................................................................ [ 62%] +........................................................................ [ 65%] +........................................................................ [ 69%] +........................................................................ [ 72%] +........................................................................ [ 75%] +........................................................................ [ 79%] +........................................................................ [ 82%] +........................................................................ [ 86%] +........................................................................ [ 89%] +........................................................................ [ 93%] +........................................................................ [ 96%] +...................................................................... [100%] +=============================== warnings summary =============================== +.venv/lib/python3.13/site-packages/fastapi/testclient.py:1 + /var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead. + from starlette.testclient import TestClient as TestClient # noqa + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +================================ tests coverage ================================ +_______________ coverage: platform linux, python 3.13.13-final-0 _______________ + +Name Stmts Miss Cover +-------------------------------------------------- +app/__init__.py 1 0 100% +app/api/__init__.py 0 0 100% +app/api/auth.py 52 0 100% +app/api/chat.py 181 0 100% +app/api/chats.py 110 0 100% +app/api/config.py 13 0 100% +app/api/doc_drafts.py 94 0 100% +app/api/docs.py 134 1 99% +app/api/git_sources.py 229 0 100% +app/api/health.py 10 0 100% +app/api/steering.py 42 0 100% +app/api/suggestions.py 33 0 100% +app/api/sync.py 115 0 100% +app/api/tokens.py 40 0 100% +app/api/ui_settings.py 55 0 100% +app/config.py 140 0 100% +app/core/__init__.py 0 0 100% +app/core/auth.py 45 0 100% +app/core/caching.py 124 0 100% +app/core/debugging.py 29 2 93% +app/core/docs_push.py 39 0 100% +app/core/errors.py 5 0 100% +app/core/logging.py 13 0 100% +app/core/rate_limit.py 44 0 100% +app/core/security_headers.py 20 0 100% +app/core/theming.py 38 0 100% +app/core/tokens.py 44 0 100% +app/db.py 21 0 100% +app/main.py 66 0 100% +app/models.py 125 0 100% +app/rag/__init__.py 0 0 100% +app/rag/agent.py 316 1 99% +app/rag/archive_upload.py 128 0 100% +app/rag/chunker.py 206 4 98% +app/rag/folder_summaries.py 121 0 100% +app/rag/git_sources.py 14 0 100% +app/rag/importer.py 197 3 98% +app/rag/llm.py 243 1 99% +app/rag/overview.py 71 0 100% +app/rag/prompts.py 88 0 100% +app/rag/retriever.py 150 3 98% +app/rag/scaffolding.py 55 0 100% +app/rag/source_removal.py 41 0 100% +app/rag/sources_meta.py 16 0 100% +app/rag/suggestions.py 27 0 100% +app/rag/summarizer.py 24 0 100% +app/schemas.py 307 0 100% +-------------------------------------------------- +TOTAL 3866 15 99% +coverage gate: app/ 99% (>90%) OK +All checks passed! +0 errors, 0 warnings, 0 informations +WARNING: there is a new pyright version available (v1.1.411 -> v1.1.414). +Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest` + +validation OK diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__03_e2e_suite_commit.a1.err b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__03_e2e_suite_commit.a1.err new file mode 100644 index 0000000..e69de29 diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__03_e2e_suite_commit.a1.md b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__03_e2e_suite_commit.a1.md new file mode 100644 index 0000000..b744eb8 --- /dev/null +++ b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__03_e2e_suite_commit.a1.md @@ -0,0 +1,21 @@ +All work for task 03 is complete and green. Per harness rules I left the move/commit to the harness (no `git add`/`commit`, task file untouched in `todo/`). + +## Report + +**Implemented** +- Rewrote `tests/e2e/test_suggestion_chips.py` in place to the phase-103 opener contract: new module docstring (opener contract + all states + run-in-isolation header); kept all scaffolding (`SEED` literal pin, `login`, autouse `saved_chats` TRUNCATE, fixture-KB import, `MOCK_ANSWER_MARKER`) +- States pinned: **seed** (unchanged), **opener-only** (NEW core state — a 3-turn chat yields EXACTLY its opener as the single chip; Q2/Q3 absent — the owner's qwen/llama.cpp scenario), **three-openers** (3 multi-turn chats, API-stamped `updated_at`, 3 openers newest-first, no follow-ups), **partial** (2 multi-turn chats → 2 opener chips, no seed top-up), **refetch** (multi-turn save → New chat → exactly the opener + 2nd `GET /api/suggestions`) +- Carried over unchanged: one-tap submit, Tab+Enter keyboard walk, mobile single-scroll row +- Regression E2Es `test_responsive_polish.py` + `test_chat_persistence.py`: green **without any edits** (they only assert chip visibility/contrast/flow, not content) + +**Gate results** +- `uv run pytest tests/e2e/test_suggestion_chips.py -v --no-cov` → 8 passed (isolation, DB up) +- `uv run pytest tests/e2e/test_responsive_polish.py -v --no-cov` → 7 passed; `.../test_chat_persistence.py` → 4 passed +- `uv run pytest --cov=app --cov-report=term-missing` → 2086 passed, **99%** total (`app/api/suggestions.py` 100%) +- `uv run ruff check .` → clean; `uv run pyright` → 0 errors + +**Notable decisions** +- Diff scope verified per Work step 4: only `app/api/suggestions.py`, `tests/integration/test_suggestions_api.py`, `tests/e2e/test_suggestion_chips.py`, `app/config.py`, `.env.example`, `README.md` + phase files; `app/rag/suggestions.py`, `frontend/`, `alembic/` have zero delta +- Skipped task step 5 (phase-dir move + commit) — harness owns both, per the pipeline override + +**Next pending task:** phase 103 complete; queue resumes at `98_sync_summary_visibility/01_summary_phase_status.md` diff --git a/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__03_e2e_suite_commit.a1.validate b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__03_e2e_suite_commit.a1.validate new file mode 100644 index 0000000..93787df --- /dev/null +++ b/.agents/reports/103_suggestions_session_openers/103_suggestions_session_openers__03_e2e_suite_commit.a1.validate @@ -0,0 +1,54883 @@ +........................................................................ [ 3%] +........................................................................ [ 6%] +........................................................................ [ 10%] +........................................................................ [ 13%] +........................................................................ [ 17%] +........................................................................ [ 20%] +........................................................................ [ 24%] +........................................................................ [ 27%] +........................................................................ [ 31%] +........................................................................ [ 34%] +........................................................................ [ 37%] +........................................................................ [ 41%] +........................................................................ [ 44%] +........................................................................ [ 48%] +........................................................................ [ 51%] +........................................................................ [ 55%] +........................................................................ [ 58%] +........................................................................ [ 62%] +........................................................................ [ 65%] +........................................................................ [ 69%] +........................................................................ [ 72%] +........................................................................ [ 75%] +........................................................................ [ 79%] +........................................................................ [ 82%] +........................................................................ [ 86%] +........................................................................ [ 89%] +...........................................................EEEEEEEEEEEEE [ 93%] +EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFF....FEEEEEEEE.......... [ 96%] +...EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 99%] +EEEE [100%] +==================================== ERRORS ==================================== +_________ ERROR at teardown of test_downgrade_to_0003_removes_columns __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") + command.upgrade(cfg, "head") + try: + yield cfg + finally: +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0004.py:49: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 45, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 45, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +----------------------------- Captured stderr call ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0018', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0017', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0016', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0015', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0014', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0013', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0012', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0011', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0010', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0009', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0008', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0007', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0006', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0005', is_upgrade=False),) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 139, in runtestprotocol + reports.append(call_and_report(item, "call", log)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 184, in pytest_runtest_call + item.runtest() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1707, in runtest + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 167, in pytest_pyfunc_call + result = testfunction(**testargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 126, in test_downgrade_to_0003_removes_columns + command.downgrade(alembic, "0003") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 534, in downgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=False),) +------------------------------ Captured log call ------------------------------- +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0018 -> 0017, folder_summaries.manually_edited: owner-edited descriptions (phase 97, task 01) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0017 -> 0016, folder_summaries: sync-time lite folder summaries (phase 94, task 01) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0016 -> 0015, ui_settings: the 8 semantic state colors (phase 93, task 01) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0015 -> 0014, ui_settings: the 9th identity color — grid_line (phase 92, task 01) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0014 -> 0013, ui_settings: single-row UI settings (phase 91) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0013 -> 0012, git_sources.ignore_paths: per-source ignore-path list (phase 89) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0012 -> 0011, api_tokens: admin-issued access tokens (phase 79) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0011 -> 0010, doc_drafts: server-side drafts of chat answers saved as docs (phase 59) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0010 -> 0009, sources_meta + saved_chats.sources_version: the KB-generation stamp (phase 53) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0009 -> 0008, saved_chats.share_token: the anonymous share link (phase 51) +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0008 -> 0007, saved_chats: owner-saved chat conversations +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0007 -> 0006, git_sources.kind + path: local-directory source discriminator +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0006 -> 0005, git sources: admin-managed list of git repo URLs +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0005 -> 0004, kb_overview: single-row, lite-generated knowledge-base outline +INFO alembic.runtime.migration:migration.py:616 Running downgrade 0004 -> 0003, document summaries: documents.summary + chunks.is_summary +--------------------------- Captured stderr teardown --------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 144, in runtestprotocol + reports.append(call_and_report(item, "teardown", log, nextitem=nextitem)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 199, in pytest_runtest_teardown + item.session._setupstate.teardown_exact(nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 568, in teardown_exact + fin() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1156, in finish + fin() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1014, in _teardown_yield_fixture + next(it) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 144, in runtestprotocol + reports.append(call_and_report(item, "teardown", log, nextitem=nextitem)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 199, in pytest_runtest_teardown + item.session._setupstate.teardown_exact(nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 568, in teardown_exact + fin() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1156, in finish + fin() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1014, in _teardown_yield_fixture + next(it) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 144, in runtestprotocol + reports.append(call_and_report(item, "teardown", log, nextitem=nextitem)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 199, in pytest_runtest_teardown + item.session._setupstate.teardown_exact(nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 568, in teardown_exact + fin() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1156, in finish + fin() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1014, in _teardown_yield_fixture + next(it) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +---------------------------- Captured log teardown ----------------------------- +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_upgrade_round_trip_restores_columns __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0004.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 45, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 45, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0004.py", line 45, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_upgrade_to_0005_creates_kb_overview __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0005.py:47: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_bare_insert_gets_single_row_defaults __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0005.py:47: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_____________ ERROR at setup of test_downgrade_to_0004_drops_table _____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0005.py:47: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_upgrade_round_trip_restores_table ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0005.py:47: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0005.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_upgrade_to_0006_creates_git_sources __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0006.py:49: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_______________ ERROR at setup of test_added_at_defaults_to_now ________________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0006.py:49: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +________________ ERROR at setup of test_duplicate_url_rejected _________________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0006.py:49: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_____________ ERROR at setup of test_downgrade_to_0005_drops_table _____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0006.py:49: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_upgrade_round_trip_restores_table ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0006.py:49: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0006.py", line 49, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_upgrade_to_0007_adds_kind_and_path ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0007.py:56: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_______________ ERROR at setup of test_pre_0007_row_reads_as_git _______________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0007.py:56: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_kind_defaults_to_git_for_new_inserts __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0007.py:56: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_check_constraint_rejects_unknown_kind _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0007.py:56: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_____________ ERROR at setup of test_duplicate_local_path_rejected _____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0007.py:56: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +____________ ERROR at setup of test_downgrade_to_0006_drops_columns ____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0007.py:56: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_upgrade_round_trip_restores_columns __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0007.py:56: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0007.py", line 56, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_upgrade_to_0008_creates_saved_chats __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0008.py:59: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_server_timestamps_stamped_on_insert __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0008.py:59: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +____________ ERROR at setup of test_updated_at_bumps_on_row_update _____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0008.py:59: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_____________ ERROR at setup of test_downgrade_to_0007_drops_table _____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0008.py:59: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_upgrade_round_trip_restores_table ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0008.py:59: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0008.py", line 59, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_upgrade_to_0009_adds_share_token ____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0009.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_unique_index_treats_nulls_as_distinct _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0009.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_unique_index_rejects_duplicate_tokens _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0009.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_downgrade_to_0008_drops_share_token __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0009.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +________ ERROR at setup of test_upgrade_round_trip_restores_share_token ________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0009.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0009.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +______ ERROR at setup of test_upgrade_to_0010_adds_sources_meta_and_stamp ______ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0010.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_inserted_rows_round_trip_the_stamp ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0010.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_____________ ERROR at setup of test_downgrade_to_0009_drops_both ______________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0010.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_upgrade_round_trip_restores_both ____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0010.py:51: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0010.py", line 51, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +____________ ERROR at setup of test_upgrade_to_0011_adds_doc_drafts ____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0011.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_ ERROR at setup of test_inserted_rows_round_trip_the_pre_push_and_pushed_states _ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0011.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_unique_index_rejects_duplicate_tokens _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0011.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_downgrade_to_0010_drops_the_table ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0011.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_upgrade_round_trip_restores_the_table _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0011.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0011.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +____________ ERROR at setup of test_upgrade_to_0012_adds_api_tokens ____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0012.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_____ ERROR at setup of test_inserted_rows_round_trip_the_lifecycle_states _____ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0012.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_ ERROR at setup of test_unique_index_rejects_duplicate_hashes_label_is_not_unique _ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0012.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_downgrade_to_0011_drops_the_table ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0012.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_upgrade_round_trip_restores_the_table _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0012.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0012.py", line 67, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_upgrade_to_0014_adds_ui_settings ____________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0014.py:47: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_inserted_id_1_row_round_trips_values __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0014.py:47: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_downgrade_to_0013_drops_the_table ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0014.py:47: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_upgrade_round_trip_restores_the_table _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0014.py:47: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0014.py", line 47, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +______ ERROR at setup of test_upgrade_to_0016_adds_the_8_semantic_columns ______ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0016.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_____ ERROR at setup of test_inserted_id_1_row_round_trips_semantic_values _____ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0016.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_downgrade_to_0015_drops_the_8_columns _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0016.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +________ ERROR at setup of test_upgrade_round_trip_restores_the_columns ________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0016.py:57: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0016.py", line 57, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_______ ERROR at setup of test_upgrade_to_0017_creates_folder_summaries ________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0017.py:52: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_______________ ERROR at setup of test_inserted_rows_round_trip ________________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0017.py:52: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +___________ ERROR at setup of test_downgrade_to_0016_drops_the_table ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0017.py:52: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_upgrade_round_trip_restores_the_table _________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0017.py:52: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0017.py", line 52, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_upgrade_to_0018_adds_manually_edited __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0018.py:50: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +__________ ERROR at setup of test_downgrade_to_0017_drops_the_column ___________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0018.py:50: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_________ ERROR at setup of test_upgrade_round_trip_restores_the_flag __________ + +self = +dialect = +context = +statement = +parameters = [immutabledict({})] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.TooManyColumns: tables can have at most 1600 columns + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: TooManyColumns + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def alembic(db: Session) -> Iterator[Config]: + """Real Alembic config bound to the dev DB (URL from app settings). + + Starts at head (repairs an interrupted earlier run); teardown upgrades + to head no matter what happened, so the dev DB is never left below + head. + """ + if not db_available(): + pytest.skip("Postgres not reachable — run `podman compose up -d db` first") + cfg = Config() # no alembic.ini file — env.py gets the URL from app config + cfg.set_main_option("script_location", "alembic") +> command.upgrade(cfg, "head") + +tests/integration/test_migration_0018.py:50: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/alembic/command.py:487: in upgrade + script.run_env() +.venv/lib/python3.13/site-packages/alembic/script/base.py:550: in run_env + util.load_python_file(self.dir, "env.py") +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:114: in load_python_file + module = load_module_py(module_id, path) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py:132: in load_module_py + spec.loader.exec_module(module) # type: ignore + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:1023: in exec_module + ??? +:488: in _call_with_frames_removed + ??? +alembic/env.py:50: in + run_migrations_online() +alembic/env.py:44: in run_migrations_online + context.run_migrations() +:8: in run_migrations + ??? +.venv/lib/python3.13/site-packages/alembic/runtime/environment.py:967: in run_migrations + self.get_context().run_migrations(**kw) +.venv/lib/python3.13/site-packages/alembic/runtime/migration.py:621: in run_migrations + step.migration_fn(**kw) +alembic/versions/0004_summary_columns.py:36: in upgrade + op.add_column("documents", sa.Column("summary", sa.Text(), nullable=True)) +:8: in add_column + ??? +:3: in add_column + ??? +.venv/lib/python3.13/site-packages/alembic/operations/ops.py:2236: in add_column + return operations.invoke(op) + ^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/base.py:448: in invoke + return fn(self, operation) + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/alembic/operations/toimpl.py:182: in add_column + operations.impl.add_column( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:384: in add_column + self._exec( +.venv/lib/python3.13/site-packages/alembic/ddl/impl.py:252: in _exec + return conn.execute(construct, params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py:188: in _execute_on_connection + return connection._execute_ddl( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1532: in _execute_ddl + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'ALTER TABLE documents ADD COLUMN summary TEXT' +params = immutabledict({}), prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.OperationalError: (psycopg.errors.TooManyColumns) tables can have at most 1600 columns +E [SQL: ALTER TABLE documents ADD COLUMN summary TEXT] +E (Background on this error at: https://sqlalche.me/e/20/e3q8) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: OperationalError +---------------------------- Captured stderr setup ----------------------------- +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 205, in __init__ + log.info("Context impl %s.", self.impl.__class__.__name__) +Message: 'Context impl %s.' +Arguments: ('PostgresqlImpl',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 42, in run_migrations_online + context.configure(connection=connection, target_metadata=target_metadata) + File "", line 8, in configure + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 936, in configure + self._migration_context = MigrationContext.configure( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 271, in configure + return MigrationContext(dialect, connection, opts, environment_context) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 208, in __init__ + log.info( +Message: 'Will assume %s DDL.' +Arguments: ('transactional',) +--- Logging error --- +Traceback (most recent call last): + File "/var/home/ducoterra/.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/logging/__init__.py", line 1154, in emit + stream.write(msg + self.terminator) + ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ +ValueError: I/O operation on closed file. +Call stack: + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/bin/pytest", line 10, in + sys.exit(_console_main()) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 253, in _console_main + code = _main(prog=_get_prog_name(sys.argv)) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/config/__init__.py", line 229, in _main + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 377, in pytest_cmdline_main + return wrap_session(config, _main) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 330, in wrap_session + session.exitstatus = doit(config, session) or 0 + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 384, in _main + config.hook.pytest_runtestloop(session=session) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/main.py", line 408, in pytest_runtestloop + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 118, in pytest_runtest_protocol + runtestprotocol(item, nextitem=nextitem) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 132, in runtestprotocol + rep = call_and_report(item, "setup", log) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 249, in call_and_report + call = CallInfo.from_call( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 361, in from_call + result: TResult | None = func() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 250, in + lambda: runtest_hook(item=item, **kwds), + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 170, in pytest_runtest_setup + item.session._setupstate.setup(item) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/runner.py", line 536, in setup + col.setup() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/python.py", line 1710, in setup + self._request._fillfixtures() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 806, in _fillfixtures + item.funcargs[argname] = self.getfixturevalue(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 630, in getfixturevalue + fixturedef = self._get_active_fixturedef(argname) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 726, in _get_active_fixturedef + fixturedef.execute(request=subrequest) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1232, in execute + result: FixtureValue = ihook.pytest_fixture_setup( + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_hooks.py", line 512, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall + res = hook_impl.function(*args) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 1328, in pytest_fixture_setup + result = call_fixture_func(fixturefunc, request, kwargs) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/_pytest/fixtures.py", line 998, in call_fixture_func + fixture_result = next(generator) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/tests/integration/test_migration_0018.py", line 50, in alembic + command.upgrade(cfg, "head") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/command.py", line 487, in upgrade + script.run_env() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 550, in run_env + util.load_python_file(self.dir, "env.py") + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 114, in load_python_file + module = load_module_py(module_id, path) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/util/pyfiles.py", line 132, in load_module_py + spec.loader.exec_module(module) # type: ignore + File "", line 1023, in exec_module + File "", line 488, in _call_with_frames_removed + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 50, in + run_migrations_online() + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/alembic/env.py", line 44, in run_migrations_online + context.run_migrations() + File "", line 8, in run_migrations + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/environment.py", line 967, in run_migrations + self.get_context().run_migrations(**kw) + File "/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/alembic/runtime/migration.py", line 616, in run_migrations + log.info("Running %s", step) +Message: 'Running %s' +Arguments: (RevisionStep('0004', is_upgrade=True),) +------------------------------ Captured log setup ------------------------------ +INFO alembic.runtime.migration:migration.py:205 Context impl PostgresqlImpl. +INFO alembic.runtime.migration:migration.py:208 Will assume transactional DDL. +INFO alembic.runtime.migration:migration.py:616 Running upgrade 0003 -> 0004, document summaries: documents.summary + chunks.is_summary +_______________ ERROR at setup of test_name_hit_chunks_real_sql ________________ + +self = +dialect = +context = +statement = +parameters = [{'id': UUID('c50519bd-eb6d-48d0-be7c-d5a9bea12107'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut... 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s...CHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)' +params = {'id': UUID('c50519bd-eb6d-48d0-be7c-d5a9bea12107'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/..., 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column "summary" of relation "documents" does not exist +E LINE 1: ...l_path, title, content, content_hash, indexed_at, summary) V... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def kb(db) -> Iterator[None]: + """A fresh KB with the incident shape: the qwen3.8 quadlet (the + name hit, with a summary chunk + an ordinary chunk), a qwen3.6 + quadlet (same family, different version — NOT a hit), an + unrelated document (FTS-only candidate), and a chunk-less document + whose name DOES carry the token (the exclusion guard).""" + db.execute(text("TRUNCATE chunks, documents")) + db.commit() + + q38 = _doc( + db, + "deploy", + "reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container", + "qwen3.8-27b-juggernaut-vulkan", + "# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0 -ctv q8_0 --jinja\n" + "-m /models/qwen3.8-27b/Qwen3.8-27B-UD-Q6_K.gguf\n", + ) + _chunk( + db, + q38, + -1, + "Podman quadlet: llama.cpp server for Qwen 3.8 27B (juggernaut).", + is_summary=True, + ) + _chunk(db, q38, 0, "# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0") +> db.flush() + +tests/integration/test_name_hit_lexical.py:106: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4353: in flush + self._flush(objects) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4488: in _flush + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/util/langhelpers.py:122: in __exit__ + raise exc_value.with_traceback(exc_tb) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4449: in _flush + flush_context.execute() +.venv/lib/python3.13/site-packages/sqlalchemy/orm/unitofwork.py:465: in execute + rec.execute(self) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/unitofwork.py:641: in execute + util.preloaded.orm_persistence.save_obj( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/persistence.py:94: in save_obj + _emit_insert_statements( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/persistence.py:1049: in _emit_insert_statements + result = connection.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s...CHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)' +params = {'id': UUID('c50519bd-eb6d-48d0-be7c-d5a9bea12107'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/..., 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column "summary" of relation "documents" does not exist +E LINE 1: ...l_path, title, content, content_hash, indexed_at, summary) V... +E ^ +E [SQL: INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s::UUID, %(source)s::VARCHAR, %(path)s::VARCHAR, %(full_path)s::VARCHAR, %(title)s::VARCHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)] +E [parameters: {'id': UUID('c50519bd-eb6d-48d0-be7c-d5a9bea12107'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', 'title': 'qwen3.8-27b-juggernaut-vulkan', 'content': '# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0 -ctv q8_0 --jinja\n-m /models/qwen3.8-27b/Qwen3.8-27B-UD-Q6_K.gguf\n', 'content_hash': '0000000000000000000000000000000000000000000000000000000000000000', 'indexed_at': datetime.datetime(2026, 9, 12, 20, 22, 19, 153547, tzinfo=datetime.timezone.utc), 'summary': None}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +______ ERROR at setup of test_lexical_candidates_name_hit_leads_real_sql _______ + +self = +dialect = +context = +statement = +parameters = [{'id': UUID('bb06f36c-e63d-436d-9996-9536858bbbe1'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut... 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s...CHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)' +params = {'id': UUID('bb06f36c-e63d-436d-9996-9536858bbbe1'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/..., 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column "summary" of relation "documents" does not exist +E LINE 1: ...l_path, title, content, content_hash, indexed_at, summary) V... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def kb(db) -> Iterator[None]: + """A fresh KB with the incident shape: the qwen3.8 quadlet (the + name hit, with a summary chunk + an ordinary chunk), a qwen3.6 + quadlet (same family, different version — NOT a hit), an + unrelated document (FTS-only candidate), and a chunk-less document + whose name DOES carry the token (the exclusion guard).""" + db.execute(text("TRUNCATE chunks, documents")) + db.commit() + + q38 = _doc( + db, + "deploy", + "reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container", + "qwen3.8-27b-juggernaut-vulkan", + "# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0 -ctv q8_0 --jinja\n" + "-m /models/qwen3.8-27b/Qwen3.8-27B-UD-Q6_K.gguf\n", + ) + _chunk( + db, + q38, + -1, + "Podman quadlet: llama.cpp server for Qwen 3.8 27B (juggernaut).", + is_summary=True, + ) + _chunk(db, q38, 0, "# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0") +> db.flush() + +tests/integration/test_name_hit_lexical.py:106: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4353: in flush + self._flush(objects) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4488: in _flush + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/util/langhelpers.py:122: in __exit__ + raise exc_value.with_traceback(exc_tb) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4449: in _flush + flush_context.execute() +.venv/lib/python3.13/site-packages/sqlalchemy/orm/unitofwork.py:465: in execute + rec.execute(self) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/unitofwork.py:641: in execute + util.preloaded.orm_persistence.save_obj( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/persistence.py:94: in save_obj + _emit_insert_statements( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/persistence.py:1049: in _emit_insert_statements + result = connection.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s...CHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)' +params = {'id': UUID('bb06f36c-e63d-436d-9996-9536858bbbe1'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/..., 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column "summary" of relation "documents" does not exist +E LINE 1: ...l_path, title, content, content_hash, indexed_at, summary) V... +E ^ +E [SQL: INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s::UUID, %(source)s::VARCHAR, %(path)s::VARCHAR, %(full_path)s::VARCHAR, %(title)s::VARCHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)] +E [parameters: {'id': UUID('bb06f36c-e63d-436d-9996-9536858bbbe1'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', 'title': 'qwen3.8-27b-juggernaut-vulkan', 'content': '# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0 -ctv q8_0 --jinja\n-m /models/qwen3.8-27b/Qwen3.8-27B-UD-Q6_K.gguf\n', 'content_hash': '0000000000000000000000000000000000000000000000000000000000000000', 'indexed_at': datetime.datetime(2026, 9, 12, 20, 22, 19, 471842, tzinfo=datetime.timezone.utc), 'summary': None}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______ ERROR at setup of test_retrieve_selects_name_hit_doc_into_top_n ________ + +self = +dialect = +context = +statement = +parameters = [{'id': UUID('3ec4d025-7e1f-4a91-a2dc-7e3a19910548'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut... 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s...CHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)' +params = {'id': UUID('3ec4d025-7e1f-4a91-a2dc-7e3a19910548'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/..., 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column "summary" of relation "documents" does not exist +E LINE 1: ...l_path, title, content, content_hash, indexed_at, summary) V... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def kb(db) -> Iterator[None]: + """A fresh KB with the incident shape: the qwen3.8 quadlet (the + name hit, with a summary chunk + an ordinary chunk), a qwen3.6 + quadlet (same family, different version — NOT a hit), an + unrelated document (FTS-only candidate), and a chunk-less document + whose name DOES carry the token (the exclusion guard).""" + db.execute(text("TRUNCATE chunks, documents")) + db.commit() + + q38 = _doc( + db, + "deploy", + "reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container", + "qwen3.8-27b-juggernaut-vulkan", + "# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0 -ctv q8_0 --jinja\n" + "-m /models/qwen3.8-27b/Qwen3.8-27B-UD-Q6_K.gguf\n", + ) + _chunk( + db, + q38, + -1, + "Podman quadlet: llama.cpp server for Qwen 3.8 27B (juggernaut).", + is_summary=True, + ) + _chunk(db, q38, 0, "# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0") +> db.flush() + +tests/integration/test_name_hit_lexical.py:106: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4353: in flush + self._flush(objects) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4488: in _flush + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/util/langhelpers.py:122: in __exit__ + raise exc_value.with_traceback(exc_tb) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4449: in _flush + flush_context.execute() +.venv/lib/python3.13/site-packages/sqlalchemy/orm/unitofwork.py:465: in execute + rec.execute(self) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/unitofwork.py:641: in execute + util.preloaded.orm_persistence.save_obj( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/persistence.py:94: in save_obj + _emit_insert_statements( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/persistence.py:1049: in _emit_insert_statements + result = connection.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s...CHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)' +params = {'id': UUID('3ec4d025-7e1f-4a91-a2dc-7e3a19910548'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/..., 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', ...} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column "summary" of relation "documents" does not exist +E LINE 1: ...l_path, title, content, content_hash, indexed_at, summary) V... +E ^ +E [SQL: INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s::UUID, %(source)s::VARCHAR, %(path)s::VARCHAR, %(full_path)s::VARCHAR, %(title)s::VARCHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)] +E [parameters: {'id': UUID('3ec4d025-7e1f-4a91-a2dc-7e3a19910548'), 'source': 'deploy', 'path': 'reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', 'full_path': '/tmp/deploy/reeseapps/ai/deployments/juggernaut/quadlets/qwen3.8-27b-juggernaut-vulkan.container', 'title': 'qwen3.8-27b-juggernaut-vulkan', 'content': '# llama.cpp juggernaut\nExec=--port 8000 -ctk q8_0 -ctv q8_0 --jinja\n-m /models/qwen3.8-27b/Qwen3.8-27B-UD-Q6_K.gguf\n', 'content_hash': '0000000000000000000000000000000000000000000000000000000000000000', 'indexed_at': datetime.datetime(2026, 9, 12, 20, 22, 19, 784959, tzinfo=datetime.timezone.utc), 'summary': None}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_git_removal_deletes_row_docs_and_checkout_dir _____ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """The registry + KB tables are global state: reset around every + test; the seeded ``sources_meta`` row resets to version 0.""" +> db.execute(text("TRUNCATE chunks, documents, kb_overview, git_sources")) + +tests/integration/test_source_removal_api.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__ ERROR at setup of test_git_removal_without_checkout_dir_is_a_noop_on_disk ___ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """The registry + KB tables are global state: reset around every + test; the seeded ``sources_meta`` row resets to version 0.""" +> db.execute(text("TRUNCATE chunks, documents, kb_overview, git_sources")) + +tests/integration/test_source_removal_api.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___ ERROR at setup of test_local_upload_removal_deletes_row_docs_and_folder ____ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """The registry + KB tables are global state: reset around every + test; the seeded ``sources_meta`` row resets to version 0.""" +> db.execute(text("TRUNCATE chunks, documents, kb_overview, git_sources")) + +tests/integration/test_source_removal_api.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_local_foreign_dir_removal_never_touches_disk ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """The registry + KB tables are global state: reset around every + test; the seeded ``sources_meta`` row resets to version 0.""" +> db.execute(text("TRUNCATE chunks, documents, kb_overview, git_sources")) + +tests/integration/test_source_removal_api.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______ ERROR at setup of test_local_prefix_sibling_dir_is_not_contained _______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """The registry + KB tables are global state: reset around every + test; the seeded ``sources_meta`` row resets to version 0.""" +> db.execute(text("TRUNCATE chunks, documents, kb_overview, git_sources")) + +tests/integration/test_source_removal_api.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_ ERROR at setup of test_sibling_guard_keeps_shared_docs_and_files_until_last_row _ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """The registry + KB tables are global state: reset around every + test; the seeded ``sources_meta`` row resets to version 0.""" +> db.execute(text("TRUNCATE chunks, documents, kb_overview, git_sources")) + +tests/integration/test_source_removal_api.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______ ERROR at setup of test_overview_failure_is_best_effort_still_204 _______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """The registry + KB tables are global state: reset around every + test; the seeded ``sources_meta`` row resets to version 0.""" +> db.execute(text("TRUNCATE chunks, documents, kb_overview, git_sources")) + +tests/integration/test_source_removal_api.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_no_docs_pruned_means_no_overview_and_no_bump ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """The registry + KB tables are global state: reset around every + test; the seeded ``sources_meta`` row resets to version 0.""" +> db.execute(text("TRUNCATE chunks, documents, kb_overview, git_sources")) + +tests/integration/test_source_removal_api.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, git_sources', params = {} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__ ERROR at setup of test_chat_turn_high_mode_receives_note_in_system_prompt ___ + +self = +dialect = +context = +statement = +parameters = [{'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def seeded_kb(db) -> Iterator[FakeRagLLM]: + """Fresh Postgres with the fixture docs imported (real pipeline).""" + db.execute(text("TRUNCATE chunks, documents, query_log, steering_notes")) + db.commit() + llm = FakeRagLLM() +> summary = asyncio.run(import_sources([FIXTURES], llm, session=db)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +tests/integration/test_steering_api.py:53: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:195: in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:118: in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py:725: in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ +app/rag/importer.py:312: in import_sources + await _index_file( +app/rag/importer.py:350: in _index_file + doc = session.scalar(select(Document).where(Document.source == source, Document.path == rel)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2421: in scalar + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2271: in _execute_internal + result: Result[Any] = compile_state_cls.orm_execute_statement( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/context.py:306: in orm_execute_statement + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ +E [SQL: SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, documents.content_hash, documents.indexed_at, documents.summary +E FROM documents +E WHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR] +E [parameters: {'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_ ERROR at teardown of test_chat_turn_high_mode_receives_note_in_system_prompt _ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InFailedSqlTransaction + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_steering(db) -> Iterator[None]: + """Steering notes + query log are global state: reset around every test.""" + db.execute(text("TRUNCATE steering_notes, query_log")) + db.commit() + yield +> db.execute(text("TRUNCATE steering_notes, query_log")) + +tests/integration/test_steering_api.py:43: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.InternalError: (psycopg.errors.InFailedSqlTransaction) current transaction is aborted, commands ignored until end of transaction block +E [SQL: TRUNCATE steering_notes, query_log] +E (Background on this error at: https://sqlalche.me/e/20/2j85) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InternalError +___ ERROR at setup of test_chat_turn_low_mode_receives_note_in_system_prompt ___ + +self = +dialect = +context = +statement = +parameters = [{'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def seeded_kb(db) -> Iterator[FakeRagLLM]: + """Fresh Postgres with the fixture docs imported (real pipeline).""" + db.execute(text("TRUNCATE chunks, documents, query_log, steering_notes")) + db.commit() + llm = FakeRagLLM() +> summary = asyncio.run(import_sources([FIXTURES], llm, session=db)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +tests/integration/test_steering_api.py:53: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:195: in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:118: in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py:725: in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ +app/rag/importer.py:312: in import_sources + await _index_file( +app/rag/importer.py:350: in _index_file + doc = session.scalar(select(Document).where(Document.source == source, Document.path == rel)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2421: in scalar + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2271: in _execute_internal + result: Result[Any] = compile_state_cls.orm_execute_statement( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/context.py:306: in orm_execute_statement + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ +E [SQL: SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, documents.content_hash, documents.indexed_at, documents.summary +E FROM documents +E WHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR] +E [parameters: {'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_ ERROR at teardown of test_chat_turn_low_mode_receives_note_in_system_prompt __ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InFailedSqlTransaction + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_steering(db) -> Iterator[None]: + """Steering notes + query log are global state: reset around every test.""" + db.execute(text("TRUNCATE steering_notes, query_log")) + db.commit() + yield +> db.execute(text("TRUNCATE steering_notes, query_log")) + +tests/integration/test_steering_api.py:43: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.InternalError: (psycopg.errors.InFailedSqlTransaction) current transaction is aborted, commands ignored until end of transaction block +E [SQL: TRUNCATE steering_notes, query_log] +E (Background on this error at: https://sqlalche.me/e/20/2j85) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InternalError +_____ ERROR at setup of test_chat_turn_without_notes_has_no_tuning_section _____ + +self = +dialect = +context = +statement = +parameters = [{'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def seeded_kb(db) -> Iterator[FakeRagLLM]: + """Fresh Postgres with the fixture docs imported (real pipeline).""" + db.execute(text("TRUNCATE chunks, documents, query_log, steering_notes")) + db.commit() + llm = FakeRagLLM() +> summary = asyncio.run(import_sources([FIXTURES], llm, session=db)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +tests/integration/test_steering_api.py:53: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:195: in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:118: in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py:725: in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ +app/rag/importer.py:312: in import_sources + await _index_file( +app/rag/importer.py:350: in _index_file + doc = session.scalar(select(Document).where(Document.source == source, Document.path == rel)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2421: in scalar + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2271: in _execute_internal + result: Result[Any] = compile_state_cls.orm_execute_statement( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/context.py:306: in orm_execute_statement + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ +E [SQL: SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, documents.content_hash, documents.indexed_at, documents.summary +E FROM documents +E WHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR] +E [parameters: {'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___ ERROR at teardown of test_chat_turn_without_notes_has_no_tuning_section ____ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InFailedSqlTransaction + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_steering(db) -> Iterator[None]: + """Steering notes + query log are global state: reset around every test.""" + db.execute(text("TRUNCATE steering_notes, query_log")) + db.commit() + yield +> db.execute(text("TRUNCATE steering_notes, query_log")) + +tests/integration/test_steering_api.py:43: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.InternalError: (psycopg.errors.InFailedSqlTransaction) current transaction is aborted, commands ignored until end of transaction block +E [SQL: TRUNCATE steering_notes, query_log] +E (Background on this error at: https://sqlalche.me/e/20/2j85) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InternalError +_________ ERROR at setup of test_chat_turn_numbers_notes_oldest_first __________ + +self = +dialect = +context = +statement = +parameters = [{'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def seeded_kb(db) -> Iterator[FakeRagLLM]: + """Fresh Postgres with the fixture docs imported (real pipeline).""" + db.execute(text("TRUNCATE chunks, documents, query_log, steering_notes")) + db.commit() + llm = FakeRagLLM() +> summary = asyncio.run(import_sources([FIXTURES], llm, session=db)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +tests/integration/test_steering_api.py:53: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:195: in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:118: in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py:725: in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ +app/rag/importer.py:312: in import_sources + await _index_file( +app/rag/importer.py:350: in _index_file + doc = session.scalar(select(Document).where(Document.source == source, Document.path == rel)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2421: in scalar + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2271: in _execute_internal + result: Result[Any] = compile_state_cls.orm_execute_statement( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/context.py:306: in orm_execute_statement + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ +E [SQL: SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, documents.content_hash, documents.indexed_at, documents.summary +E FROM documents +E WHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR] +E [parameters: {'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________ ERROR at teardown of test_chat_turn_numbers_notes_oldest_first ________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InFailedSqlTransaction + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_steering(db) -> Iterator[None]: + """Steering notes + query log are global state: reset around every test.""" + db.execute(text("TRUNCATE steering_notes, query_log")) + db.commit() + yield +> db.execute(text("TRUNCATE steering_notes, query_log")) + +tests/integration/test_steering_api.py:43: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.InternalError: (psycopg.errors.InFailedSqlTransaction) current transaction is aborted, commands ignored until end of transaction block +E [SQL: TRUNCATE steering_notes, query_log] +E (Background on this error at: https://sqlalche.me/e/20/2j85) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InternalError +___________ ERROR at setup of test_multiple_turns_keep_reading_notes ___________ + +self = +dialect = +context = +statement = +parameters = [{'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture() + def seeded_kb(db) -> Iterator[FakeRagLLM]: + """Fresh Postgres with the fixture docs imported (real pipeline).""" + db.execute(text("TRUNCATE chunks, documents, query_log, steering_notes")) + db.commit() + llm = FakeRagLLM() +> summary = asyncio.run(import_sources([FIXTURES], llm, session=db)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +tests/integration/test_steering_api.py:53: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:195: in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py:118: in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +../../../.local/share/uv/python/cpython-3.13.13-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py:725: in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ +app/rag/importer.py:312: in import_sources + await _index_file( +app/rag/importer.py:350: in _index_file + doc = session.scalar(select(Document).where(Document.source == source, Document.path == rel)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2421: in scalar + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2271: in _execute_internal + result: Result[Any] = compile_state_cls.orm_execute_statement( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/context.py:306: in orm_execute_statement + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, docum...nts.summary \nFROM documents \nWHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR' +params = {'source_1': 'docs', 'path_1': 'deployments/new-service.md'} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column documents.summary does not exist +E LINE 1: ...nt, documents.content_hash, documents.indexed_at, documents.... +E ^ +E [SQL: SELECT documents.id, documents.source, documents.path, documents.full_path, documents.title, documents.content, documents.content_hash, documents.indexed_at, documents.summary +E FROM documents +E WHERE documents.source = %(source_1)s::VARCHAR AND documents.path = %(path_1)s::VARCHAR] +E [parameters: {'source_1': 'docs', 'path_1': 'deployments/new-service.md'}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_________ ERROR at teardown of test_multiple_turns_keep_reading_notes __________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InFailedSqlTransaction + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_steering(db) -> Iterator[None]: + """Steering notes + query log are global state: reset around every test.""" + db.execute(text("TRUNCATE steering_notes, query_log")) + db.commit() + yield +> db.execute(text("TRUNCATE steering_notes, query_log")) + +tests/integration/test_steering_api.py:43: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE steering_notes, query_log', params = {}, prepare = None +binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.InternalError: (psycopg.errors.InFailedSqlTransaction) current transaction is aborted, commands ignored until end of transaction block +E [SQL: TRUNCATE steering_notes, query_log] +E (Background on this error at: https://sqlalche.me/e/20/2j85) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: InternalError +_________________ ERROR at setup of test_empty_db_returns_seed _________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___________ ERROR at setup of test_a_chats_follow_ups_never_surface ____________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________________ ERROR at setup of test_cap_three_across_chats _________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________________ ERROR at setup of test_newer_chat_walked_first ________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________ ERROR at setup of test_verbatim_reask_counts_once_across_chats ________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__________ ERROR at setup of test_dedup_is_exact_not_case_insensitive __________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_exactly_two_questions_give_exactly_two_chips ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +______ ERROR at setup of test_exactly_one_question_gives_exactly_one_chip ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_brain_and_blank_user_texts_contribute_nothing _____ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_leading_blank_user_entry_does_not_disqualify ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___________ ERROR at setup of test_all_brain_deployment_returns_seed ___________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___________________ ERROR at setup of test_anonymous_is_401 ____________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "saved_chats" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_chats(db: Session) -> Iterator[None]: + """``saved_chats`` is global state: reset around every test.""" +> db.execute(text("TRUNCATE saved_chats")) + +tests/integration/test_suggestions_api.py:83: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE saved_chats', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "saved_chats" does not exist +E [SQL: TRUNCATE saved_chats] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_________ ERROR at setup of test_anonymous_gets_403_on_both_endpoints __________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________ ERROR at setup of test_admin_sync_success_reports_full_detail _________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__________ ERROR at setup of test_unchanged_kb_skips_overview_refresh __________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______ ERROR at setup of test_double_trigger_while_running_returns_409 ________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______ ERROR at setup of test_git_failure_marks_failed_and_skips_import _______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__________ ERROR at setup of test_no_sources_configured_fails_loudly ___________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_________________ ERROR at setup of test_db_rows_win_over_env __________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____________ ERROR at setup of test_env_fallback_when_table_empty _____________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +______________ ERROR at setup of test_local_only_sync_imports_dir ______________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__ ERROR at setup of test_mixed_git_local_sync_imports_both_and_prunes_union ___ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__ ERROR at setup of test_missing_local_dir_fails_loudly_and_imports_nothing ___ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___ ERROR at setup of test_import_error_is_reported_with_credentials_masked ____ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________ ERROR at setup of test_model_down_fails_fast_before_any_clone _________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__ ERROR at setup of test_probe_names_dead_embed_model_and_masks_credentials ___ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__________ ERROR at setup of test_probe_runs_before_source_resolution __________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______ ERROR at setup of test_local_row_ignore_paths_excluded_from_sync _______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___ ERROR at setup of test_sync_builds_ignore_map_by_root_string_with_union ____ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +______ ERROR at setup of test_sync_without_ignore_lists_passes_empty_map _______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "folder_summaries" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_folder_summaries(db: Session) -> Iterator[None]: + """Phase 94: the ``folder_summaries`` table is global state the real + generator (the real-import tests) writes — truncated around every + sync test so the change-gate / table-empty-gate assertions start + from a known (empty) table.""" +> db.execute(text("TRUNCATE folder_summaries")) + +tests/integration/test_sync_api.py:198: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE folder_summaries', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "folder_summaries" does not exist +E [SQL: TRUNCATE folder_summaries] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_________ ERROR at setup of test_changed_import_generates_folder_rows __________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +______ ERROR at setup of test_unchanged_reimport_burns_zero_folder_calls _______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_ ERROR at setup of test_unchanged_reimport_with_gap_fills_only_the_missing_row _ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________ ERROR at setup of test_changed_reimport_is_a_full_regeneration ________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______ ERROR at setup of test_subtree_dropping_below_two_docs_is_pruned _______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_ ERROR at setup of test_folder_lite_failure_keeps_previous_row_and_stays_green _ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_changed_import_never_overwrites_a_manual_row ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___________ ERROR at setup of test_limit_run_skips_folder_generation ___________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________ ERROR at setup of test_empty_table_generates_on_unchanged_walk ________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________ ERROR at setup of test_api_changed_sync_generates_folder_rows _________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_api_unchanged_resync_burns_zero_folder_calls ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_ ERROR at setup of test_api_unchanged_resync_with_gap_fills_only_the_missing_row _ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_ ERROR at setup of test_api_folder_lite_failure_keeps_rows_stays_green_and_bumps _ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +________ ERROR at setup of test_api_empty_table_first_sync_regenerates _________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "kb_overview" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def _clean_kb(db: Session) -> Iterator[None]: + """Global KB + registry state, truncated around every test (the + real import and the real generator write ``documents``/``chunks``/ + ``folder_summaries``; the API tests seed ``git_sources``).""" +> db.execute( + text("TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources") + ) + +tests/integration/test_sync_folder_summaries.py:149: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources' +params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "kb_overview" does not exist +E [SQL: TRUNCATE chunks, documents, kb_overview, folder_summaries, git_sources] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +______________ ERROR at setup of test_anonymous_403_on_all_routes ______________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +______ ERROR at setup of test_admin_create_returns_plaintext_exactly_once ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__________ ERROR at setup of test_two_tokens_same_label_both_created ___________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__________ ERROR at setup of test_create_blank_or_overlong_label_422 ___________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_revoke_204_idempotent_and_preserves_last_used _____ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___________ ERROR at setup of test_regenerate_201_rotates_atomically ___________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______________ ERROR at setup of test_regenerate_unknown_id_404 _______________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +____________ ERROR at setup of test_regenerate_already_revoked_409 _____________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____________ ERROR at setup of test_regenerate_403_for_token_user _____________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_________________ ERROR at setup of test_revoke_unknown_id_404 _________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_________________ ERROR at setup of test_list_is_newest_first __________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "api_tokens" does not exist + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_tokens(db: Session) -> Iterator[None]: + """api_tokens is global state: reset around every test.""" +> db.execute(text("TRUNCATE api_tokens")) + +tests/integration/test_tokens_api.py:60: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'TRUNCATE api_tokens', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "api_tokens" does not exist +E [SQL: TRUNCATE api_tokens] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_______________ ERROR at setup of test_anonymous_get_and_put_403 _______________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """Both touched tables are global state: the single ui_settings row + and the api_tokens the token-user test creates (the house + TRUNCATE/DELETE reset pattern).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_ui_settings_api.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +______________ ERROR at setup of test_token_user_get_and_put_403 _______________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """Both touched tables are global state: the single ui_settings row + and the api_tokens the token-user test creates (the house + TRUNCATE/DELETE reset pattern).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_ui_settings_api.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_________________ ERROR at setup of test_admin_get_and_put_200 _________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """Both touched tables are global state: the single ui_settings row + and the api_tokens the token-user test creates (the house + TRUNCATE/DELETE reset pattern).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_ui_settings_api.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_admin_grid_line_validation_and_normalization ______ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """Both touched tables are global state: the single ui_settings row + and the api_tokens the token-user test creates (the house + TRUNCATE/DELETE reset pattern).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_ui_settings_api.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +___________ ERROR at setup of test_admin_semantic_fields_round_trip ____________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """Both touched tables are global state: the single ui_settings row + and the api_tokens the token-user test creates (the house + TRUNCATE/DELETE reset pattern).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_ui_settings_api.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +__ ERROR at setup of test_api_config_env_only_deployment_returns_env_strings ___ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """Both touched tables are global state: the single ui_settings row + and the api_tokens the token-user test creates (the house + TRUNCATE/DELETE reset pattern).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_ui_settings_api.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +____________ ERROR at setup of test_api_config_carries_no_theme_key ____________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """Both touched tables are global state: the single ui_settings row + and the api_tokens the token-user test creates (the house + TRUNCATE/DELETE reset pattern).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_ui_settings_api.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____ ERROR at setup of test_api_config_returns_db_strings_after_admin_put _____ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +db = + + @pytest.fixture(autouse=True) + def clean_state(db: Session) -> Iterator[None]: + """Both touched tables are global state: the single ui_settings row + and the api_tokens the token-user test creates (the house + TRUNCATE/DELETE reset pattern).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_ui_settings_api.py:45: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +=================================== FAILURES =================================== +_________________________ test_name_hit_limit_real_sql _________________________ + +self = +dialect = +context = +statement = +parameters = [{'id': UUID('8f881ec9-ef5d-4836-91c7-5a66752d382a'), 'source': 'S', 'path': 'quadlets/m00-qwen38.container', 'full_path': '/tmp/S/quadlets/m00-qwen38.container', ...}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s...CHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)' +params = {'id': UUID('8f881ec9-ef5d-4836-91c7-5a66752d382a'), 'source': 'S', 'path': 'quadlets/m00-qwen38.container', 'full_path': '/tmp/S/quadlets/m00-qwen38.container', ...} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedColumn: column "summary" of relation "documents" does not exist +E LINE 1: ...l_path, title, content, content_hash, indexed_at, summary) V... +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedColumn + +The above exception was the direct cause of the following exception: + +db = + + def test_name_hit_limit_real_sql(db) -> None: + """Twelve identical (1, 6) name hits — the LATERAL fetch (and the + output) carries exactly ``NAME_HIT_LIMIT`` winners, catalog order.""" + db.execute(text("TRUNCATE chunks, documents")) + db.commit() + for i in range(12): + doc = _doc( + db, "S", f"quadlets/m{i:02d}-qwen38.container", f"m{i:02d}-qwen38", "llama cpp qwen38\n" + ) +> db.flush() + +tests/integration/test_name_hit_lexical.py:199: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4353: in flush + self._flush(objects) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4488: in _flush + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ +.venv/lib/python3.13/site-packages/sqlalchemy/util/langhelpers.py:122: in __exit__ + raise exc_value.with_traceback(exc_tb) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:4449: in _flush + flush_context.execute() +.venv/lib/python3.13/site-packages/sqlalchemy/orm/unitofwork.py:465: in execute + rec.execute(self) +.venv/lib/python3.13/site-packages/sqlalchemy/orm/unitofwork.py:641: in execute + util.preloaded.orm_persistence.save_obj( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/persistence.py:94: in save_obj + _emit_insert_statements( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/persistence.py:1049: in _emit_insert_statements + result = connection.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s...CHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)' +params = {'id': UUID('8f881ec9-ef5d-4836-91c7-5a66752d382a'), 'source': 'S', 'path': 'quadlets/m00-qwen38.container', 'full_path': '/tmp/S/quadlets/m00-qwen38.container', ...} +prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedColumn) column "summary" of relation "documents" does not exist +E LINE 1: ...l_path, title, content, content_hash, indexed_at, summary) V... +E ^ +E [SQL: INSERT INTO documents (id, source, path, full_path, title, content, content_hash, indexed_at, summary) VALUES (%(id)s::UUID, %(source)s::VARCHAR, %(path)s::VARCHAR, %(full_path)s::VARCHAR, %(title)s::VARCHAR, %(content)s::VARCHAR, %(content_hash)s::VARCHAR, %(indexed_at)s::TIMESTAMP WITH TIME ZONE, %(summary)s::VARCHAR)] +E [parameters: {'id': UUID('8f881ec9-ef5d-4836-91c7-5a66752d382a'), 'source': 'S', 'path': 'quadlets/m00-qwen38.container', 'full_path': '/tmp/S/quadlets/m00-qwen38.container', 'title': 'm00-qwen38', 'content': 'llama cpp qwen38\n', 'content_hash': '0000000000000000000000000000000000000000000000000000000000000000', 'indexed_at': datetime.datetime(2026, 9, 12, 20, 22, 20, 113116, tzinfo=datetime.timezone.utc), 'summary': None}] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +_____________________ test_page_carries_all_three_headers ______________________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +client = +db = + + def test_page_carries_all_three_headers(client: TestClient, db: Session) -> None: + """``GET /`` (the shell page) — 200 + all three headers, CSP exactly + the A1 string. The ``ui_settings`` row is cleared first (phase 91, + task 05: a themed page carries the A1 string EXTENDED with the + style-src hash — the plain-A1 pin is the UNTHAMED page's + contract, and the dev database must not leak a theme into it).""" +> db.execute(text("DELETE FROM ui_settings")) + +tests/integration/test_security_headers.py:67: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2373: in execute + return self._execute_internal( +.venv/lib/python3.13/site-packages/sqlalchemy/orm/session.py:2280: in _execute_internal + result = conn.execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1421: in execute + return meth( +.venv/lib/python3.13/site-packages/sqlalchemy/sql/elements.py:526: in _execute_on_connection + return connection._execute_clauseelement( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1643: in _execute_clauseelement + ret = self._execute_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1848: in _execute_context + return self._exec_single_context( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1988: in _exec_single_context + self._handle_dbapi_exception( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:2365: in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: in _exec_single_context + self.dialect.do_execute( +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedTable) relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ +E [SQL: DELETE FROM ui_settings] +E (Background on this error at: https://sqlalche.me/e/20/f405) + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: ProgrammingError +____________ test_themed_page_carries_a1_plus_style_src_theme_hash _____________ + +self = +dialect = +context = +statement = +parameters = [{}] + + def _exec_single_context( + self, + dialect: Dialect, + context: ExecutionContext, + statement: Union[str, Compiled], + parameters: Optional[_AnyMultiExecuteParams], + ) -> CursorResult[Any]: + """continue the _execute_context() method for a single DBAPI + cursor.execute() or cursor.executemany() call. + + """ + if dialect.bind_typing is BindTyping.SETINPUTSIZES: + generic_setinputsizes = context._prepare_set_input_sizes() + + if generic_setinputsizes: + try: + dialect.do_set_input_sizes( + context.cursor, generic_setinputsizes, context + ) + except BaseException as e: + self._handle_dbapi_exception( + e, str(statement), parameters, None, context + ) + + cursor, str_statement, parameters = ( + context.cursor, + context.statement, + context.parameters, + ) + + effective_parameters: Optional[_AnyExecuteParams] + + if not context.executemany: + effective_parameters = parameters[0] + else: + effective_parameters = parameters + + if self._has_events or self.engine._has_events: + for fn in self.dispatch.before_cursor_execute: + str_statement, effective_parameters = fn( + self, + cursor, + str_statement, + effective_parameters, + context, + context.executemany, + ) + + if self._echo: + self._log_info(str_statement) + + stats = context._get_cache_stats() + + if not self.engine.hide_parameters: + self._log_info( + "[%s] %r", + stats, + sql_util._repr_params( + effective_parameters, + batches=10, + ismulti=context.executemany, + ), + ) + else: + self._log_info( + "[%s] [SQL parameters hidden due to hide_parameters=True]", + stats, + ) + + evt_handled: bool = False + try: + if context.execute_style is ExecuteStyle.EXECUTEMANY: + effective_parameters = cast( + "_CoreMultiExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_executemany: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: + self.dialect.do_executemany( + cursor, + str_statement, + effective_parameters, + context, + ) + elif not effective_parameters and context.no_parameters: + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute_no_params: + if fn(cursor, str_statement, context): + evt_handled = True + break + if not evt_handled: + self.dialect.do_execute_no_params( + cursor, str_statement, context + ) + else: + effective_parameters = cast( + "_CoreSingleExecuteParams", effective_parameters + ) + if self.dialect._has_events: + for fn in self.dialect.dispatch.do_execute: + if fn( + cursor, + str_statement, + effective_parameters, + context, + ): + evt_handled = True + break + if not evt_handled: +> self.dialect.do_execute( + cursor, str_statement, effective_parameters, context + ) + +.venv/lib/python3.13/site-packages/sqlalchemy/engine/base.py:1969: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +.venv/lib/python3.13/site-packages/sqlalchemy/engine/default.py:952: in do_execute + cursor.execute(statement, parameters) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = +query = 'DELETE FROM ui_settings', params = {}, prepare = None, binary = None + + def execute( + self, + query: Query, + params: Params | None = None, + *, + prepare: bool | None = None, + binary: bool | None = None, + ) -> Self: + """ + Execute a query or command to the database. + """ + try: + with self._conn.lock: + self._conn.wait( + self._execute_gen(query, params, prepare=prepare, binary=binary) + ) + except e._NO_TRACEBACK as ex: +> raise ex.with_traceback(None) +E psycopg.errors.UndefinedTable: relation "ui_settings" does not exist +E LINE 1: DELETE FROM ui_settings +E ^ + +.venv/lib/python3.13/site-packages/psycopg/cursor.py:117: UndefinedTable + +The above exception was the direct cause of the following exception: + +client = +db = + + def test_themed_page_carries_a1_plus_style_src_theme_hash( + client: TestClient, db: Session + ) -> None: + """Phase 91 (task 05, defect fix): the A1 CSP would BLOCK the + inline ``