Skip to content

Conversation

@HaiQ31
Copy link

@HaiQ31 HaiQ31 commented Nov 27, 2025

networks in the future scenarios 1 and 2 contains % char in the headings of csv StorageProfiles.csv and in the body of Storage.csv. This leads to IndexError: tuple index out of range raised by psycopg2 method execute_batch which is called from pandapowers function upload_sql_table.

Pandapowers SQL method creates tables for every dataframe in a net-object or in a dict in the net-object. In this way profiles_storage is created with column names equal to the names in the dataframe.
The reasons for the error seems to be, that execute_batch kind of "counts" the locations where to put values in the sql string by the number or % in the base sql string. Since the names of StorageProfiles contains % it tries to access more items in the tuple of values than the tuple contains.

with the PR, the % in all profile names (only occurs in Storages) are replaced by pr.

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.

1 participant