refactor(tradein): drop dead schema — sale_type_text column + audit_log (#731) #893

Merged
bot-reviewer merged 1 commit from feat/731-dead-schema into main 2026-05-31 13:13:44 +00:00
Collaborator

Summary

Verified-safe subset of TradeinDb_Audit_May30 (analyst-pruned scope — does NOT touch the code-referenced empty tables).

  • Removed sale_type_text references (column is 100% NULL, code-only): yandex_detail.py (model field + parse block + ctor kwarg), conflict_resolution.py priority map. Tests updated (test_yandex_detail.py, test_conflict_resolution.py). grep sale_type_text app+tests = 0.
  • Migration 095 dead_schema.sql: ALTER TABLE listings DROP COLUMN IF EXISTS sale_type_text; DROP TABLE IF EXISTS audit_log; (audit_log: 0 rows, 0 refs, no triggers). BEGIN/COMMIT, IF EXISTS, idempotent.
  • Drive-by: 2 pre-existing UP038 lints in conflict_resolution.py fixed (isinstance tuple→union) — surfaced by the pre-commit hook once the file was staged.

Explicitly NOT dropped: houses_price_dynamics/agents/sellers/estimate_photos/house_reviews/listings_snapshots (all code-referenced roadmap, per spec).

Test plan

  • pytest -k "estimator or search or listings or base" → 265 passed (1 pre-existing unrelated auth-401 failure); changed test files 70/70 pass; ruff clean.
  • Live (qa/ops): /estimate 200; information_schema.columns has no listings.sale_type_text; audit_log gone.

⚠️ Migration auto-applies to prod on deploy. Low-risk (drops a 100%-NULL column + a 0-row table), but reviewer should confirm audit_log has no triggers on the live DB before applying (spec verified it does not).

Refs #731

## Summary Verified-safe subset of `TradeinDb_Audit_May30` (analyst-pruned scope — does NOT touch the code-referenced empty tables). - Removed `sale_type_text` references (column is 100% NULL, code-only): `yandex_detail.py` (model field + parse block + ctor kwarg), `conflict_resolution.py` priority map. Tests updated (`test_yandex_detail.py`, `test_conflict_resolution.py`). `grep sale_type_text app+tests` = **0**. - Migration **095** `dead_schema.sql`: `ALTER TABLE listings DROP COLUMN IF EXISTS sale_type_text; DROP TABLE IF EXISTS audit_log;` (audit_log: 0 rows, 0 refs, no triggers). `BEGIN/COMMIT`, `IF EXISTS`, idempotent. - Drive-by: 2 pre-existing `UP038` lints in `conflict_resolution.py` fixed (isinstance tuple→union) — surfaced by the pre-commit hook once the file was staged. Explicitly NOT dropped: `houses_price_dynamics/agents/sellers/estimate_photos/house_reviews/listings_snapshots` (all code-referenced roadmap, per spec). ## Test plan - [x] `pytest -k "estimator or search or listings or base"` → 265 passed (1 pre-existing unrelated auth-401 failure); changed test files 70/70 pass; ruff clean. - [ ] Live (qa/ops): `/estimate` 200; `information_schema.columns` has no `listings.sale_type_text`; `audit_log` gone. ⚠️ Migration **auto-applies to prod on deploy**. Low-risk (drops a 100%-NULL column + a 0-row table), but reviewer should confirm `audit_log` has no triggers on the live DB before applying (spec verified it does not). Refs #731
bot-backend added 1 commit 2026-05-31 12:58:34 +00:00
Verified-safe subset of TradeinDb_Audit_May30 (analyst-pruned).
- remove sale_type_text refs from yandex_detail.py (model field + parse + ctor)
  and conflict_resolution.py priority map (column 100% NULL, code-only)
- migration 095: ALTER listings DROP COLUMN sale_type_text; DROP TABLE audit_log
  (0 rows, 0 refs, no triggers). BEGIN/COMMIT + IF EXISTS, idempotent.

Refs #731
bot-reviewer merged commit fa2bd20ac6 into main 2026-05-31 13:13:44 +00:00
bot-reviewer deleted branch feat/731-dead-schema 2026-05-31 13:13:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#893
No description provided.