Fix profiler overwrite table semantics - #2581
Open
dgomez04 wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2581 +/- ##
==========================================
- Coverage 70.40% 70.37% -0.04%
==========================================
Files 107 107
Lines 9661 9661
Branches 1070 1068 -2
==========================================
- Hits 6802 6799 -3
- Misses 2653 2657 +4
+ Partials 206 205 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
✅ 174/174 passed, 9 flaky, 2 skipped, 1h9m37s total Flaky tests:
Running from acceptance #5138 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Profiler
overwritemode replaced rows withTRUNCATE+INSERTwhile retaining the existing DuckDB table definition. For tables created through inferred schemas, a first run could persist a narrow type such asDECIMAL(10,8). A same-day rerun with larger values then failed during insertion because the stale schema was reused.Solution
DROP+CREATE TABLE AS SELECTon overwrite so both the definition and data reflect the current run.Tests:
.venv/bin/python -m pytest tests/unit/assessment/test_duckdb_helpers.py -q --tb=short(13 passed)Follow-up
We need to consolidate profiler writes behind a single API.
_save_overwrite,save_to_duckdb, and_save_to_dbcurrently provide overlapping write paths and can drift in behavior. A separate issue will be created to track that consolidation.