Skip to content

Fix OperationalError for large datasets with scse-toolkits chunking facilities#255

Open
meksor wants to merge 5 commits into
mainfrom
bugfix/db-parameter-limits
Open

Fix OperationalError for large datasets with scse-toolkits chunking facilities#255
meksor wants to merge 5 commits into
mainfrom
bugfix/db-parameter-limits

Conversation

@meksor

@meksor meksor commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Uses the scse-toolkit functionality from https://github.com/iiasa/scse-toolkit/pull/58 to fix the error described in #254 .
Pins scse-toolkit (>=1.2.0,<2.0.0).

Migrates both list_model_names methods (RunRepository, TimeSeriesRepository) to use toolkits select_in_chunks so large IN lists are avoided. merge_regions and merge_units of TimeSeriesService now use tabulate_by_df, which also chunks.

Closes #254

@meksor meksor marked this pull request as ready for review June 25, 2026 12:38
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.7%. Comparing base (9e97d27) to head (329b661).

Files with missing lines Patch % Lines
ixmp4/data/meta/service.py 60.0% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #255   +/-   ##
=====================================
  Coverage   96.7%   96.7%           
=====================================
  Files        221     221           
  Lines       9841    9845    +4     
=====================================
+ Hits        9520    9524    +4     
  Misses       321     321           
Files with missing lines Coverage Δ
ixmp4/data/iamc/timeseries/repositories.py 97.9% <100.0%> (+<0.1%) ⬆️
ixmp4/data/iamc/timeseries/service.py 99.1% <100.0%> (ø)
ixmp4/data/run/repositories.py 96.9% <100.0%> (+<0.1%) ⬆️
ixmp4/data/meta/service.py 97.0% <60.0%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danielhuppmann danielhuppmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like magic...

@phackstock phackstock left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me thanks @meksor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OperationalError writing large datasets to the database

3 participants