Skip to content

Commit

Permalink
Connection: fixed - apply defaults after loading param from file
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Jan 28, 2025
1 parent 83a7b5b commit b59d434
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion omnipath_server/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(
parameters include the host, port, database, user and password.
"""

self._param = {**DEFAULTS, **(param or kwargs)}
self._param = param or kwargs
self.chunk_size = chunk_size
self._parse_param()

Expand All @@ -67,6 +67,10 @@ def _parse_param(self) -> None:

self._from_file()

if isinstance(self._param, dict):

self._param = {**DEFAULTS, **self._param}


def _from_file(self) -> None:
"""
Expand All @@ -79,6 +83,11 @@ def _from_file(self) -> None:

self._param = yaml.load(fp, Loader = yaml.FullLoader)

else:

self._param = {}


@property
def _uri(self) -> str:
"""
Expand Down

0 comments on commit b59d434

Please sign in to comment.