Skip to content

Commit

Permalink
Replace unavailable function
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraBuettner committed Sep 19, 2023
1 parent 73bfb63 commit cbcbd50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions etrago/tools/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def results_to_oedb(session, network, args, grid="hv", safe_results=False):

print("Uploading results to db...")
# get last result id and get new one
last_res_id = session.query(func.max(ResultMeta.result_id)).scalar()
last_res_id = session.query(max(ResultMeta.result_id)).scalar()
if last_res_id == None:
new_res_id = 1
else:
Expand Down Expand Up @@ -539,7 +539,7 @@ def results_to_oedb(session, network, args, grid="hv", safe_results=False):
if network.generators.carrier[gen] not in sources.name.values:
new_source = Source()
new_source.source_id = (
session.query(func.max(Source.source_id)).scalar() + 1
session.query(max(Source.source_id)).scalar() + 1
)
new_source.name = network.generators.carrier[gen]
session.add(new_source)
Expand All @@ -564,7 +564,7 @@ def results_to_oedb(session, network, args, grid="hv", safe_results=False):
if network.storage_units.carrier[stor] not in sources.name.values:
new_source = Source()
new_source.source_id = (
session.query(func.max(Source.source_id)).scalar() + 1
session.query(max(Source.source_id)).scalar() + 1
)
new_source.name = network.storage_units.carrier[stor]
session.add(new_source)
Expand Down

0 comments on commit cbcbd50

Please sign in to comment.