Skip to content

Commit

Permalink
fixing bug preventing usage of connection uri
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Nov 14, 2018
1 parent a7045e9 commit dc5b7e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mds/db/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def data_engine(uri=None, **kwargs):
backend = kwargs["backend"] if "backend" in kwargs else "postgresql"
user, password, host, port, db = kwargs["user"], kwargs["password"], kwargs["host"], kwargs["port"], kwargs["db"]
uri = f"{backend}://{user}:{password}@{host}:{port}/{db}"
else:
raise KeyError()
elif uri is None:
raise KeyError("Provide either `uri` or `user`, `password`, `host`, `port`, and `db`.")

return sqlalchemy.create_engine(uri)

Expand Down

0 comments on commit dc5b7e0

Please sign in to comment.