Skip to content

Commit

Permalink
Merge pull request #195 from ie3-institute/to/dev
Browse files Browse the repository at this point in the history
Minor adaptions
  • Loading branch information
t-ober authored May 3, 2024
2 parents 1373738 + e6f332f commit a879ecb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pypsdm/db/weather/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ def create_engine_from_env(echo=False) -> Engine:
port = os.getenv("WEATHER_DB_PORT")
database = os.getenv("WEATHER_DB_NAME")
DATABASE_URL = f"postgresql://{username}:{password}@{host}:{port}/{database}"
return create_engine(DATABASE_URL, echo=echo)
try:
return create_engine(DATABASE_URL, echo=echo)
except Exception as e:
raise ValueError(
f"Failed to create engine with database url: {DATABASE_URL}"
) from e


def create_engine_from_params(
Expand Down
1 change: 1 addition & 0 deletions pypsdm/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from .input import *
from .primary_data import *
from .result import *
from .ts import *

0 comments on commit a879ecb

Please sign in to comment.