Fix DuplicateColumn bug in save_parameters_numpy()#12707
Fix DuplicateColumn bug in save_parameters_numpy()#12707jonathan-eq merged 1 commit intoequinor:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12707 +/- ##
==========================================
- Coverage 90.67% 90.63% -0.05%
==========================================
Files 429 431 +2
Lines 29803 30113 +310
==========================================
+ Hits 27025 27292 +267
- Misses 2778 2821 +43
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ec7088f to
4f5218b
Compare
xjules
left a comment
There was a problem hiding this comment.
Nice @jonathan-eq ! Could you maybe update the commit message bit to explain where was this issue?
4f5218b to
8ba0cd5
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in save_parameters_numpy() where calling the method multiple times with the same parameter name would raise a DuplicateColumn error instead of properly overwriting existing values.
Changes:
- Added logic to drop existing columns (except "realization") before joining new parameter data
- Added a regression test verifying that multiple saves to the same parameter successfully overwrite previous values
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ert/storage/local_ensemble.py | Drops duplicate columns before joining to prevent DuplicateColumn errors |
| tests/ert/unit_tests/storage/test_local_storage.py | Adds regression test for multiple parameter saves |
This fixes the issue in the performance tests, where we try saving the same parameter key to store multiple times; expecting it to overwrite the value.
8ba0cd5 to
37f3120
Compare
|
Successfully created backport PR for |
|
Successfully created backport PR for |
Issue
Resolves #12706
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'just rapid-tests')When applicable