Skip to content

Commit

Permalink
Merge pull request #935 from openego/fixes/heat-supply-if-condition
Browse files Browse the repository at this point in the history
Insert backup resitive heaters only if not empty
  • Loading branch information
ClaraBuettner committed Nov 1, 2022
2 parents a48f9ec + 940b475 commit c30aa8a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/egon/data/datasets/heat_supply/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ def district_heating():

backup_rh = backup_resistive_heaters("eGon2035")

backup_rh.to_postgis(
targets["district_heating_supply"]["table"],
schema=targets["district_heating_supply"]["schema"],
con=db.engine(),
if_exists="append",
)
if not backup_rh.empty:
backup_rh.to_postgis(
targets["district_heating_supply"]["table"],
schema=targets["district_heating_supply"]["schema"],
con=db.engine(),
if_exists="append",
)


def individual_heating():
Expand Down

0 comments on commit c30aa8a

Please sign in to comment.