Skip to content

Commit

Permalink
Fix typos and raise error on empty file path
Browse files Browse the repository at this point in the history
  • Loading branch information
TheByronHimes committed Oct 18, 2023
1 parent e40c86c commit 74f9fe9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/hexkit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def config_from_yaml(
) -> Callable:
"""A factory that returns decorator functions which extends a
pydantic BaseSettings class to read in parameters from a config yaml.
It replaces (or adds) a config settings to the BaseSettings class that configures
the priorities for parameter sources as follows (highest Priority first):
It replaces (or adds) config settings to the BaseSettings class that configures
the priorities for parameter sources as follows (highest priority first):
- parameters passed using **kwargs
- environment variables
- file secrets
Expand Down
2 changes: 1 addition & 1 deletion src/hexkit/providers/mongodb/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _document_to_dto(self, document: dict[str, Any]) -> Dto:
return self._dto_model(**document)

def _dto_to_document(self, dto: Dto) -> dict[str, Any]:
"""Converts a DTO into a representation that is compatible documents for a
"""Converts a DTO into a representation that is a compatible document for a
MongoDB Database.
"""
document = json.loads(dto.model_dump_json())
Expand Down
2 changes: 1 addition & 1 deletion src/hexkit/providers/s3/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class FileObject(BaseModel):
def content(self) -> bytes:
"""Extract the content from the file at the provided path"""
if not self.file_path:
return b"will be overwritten"
raise ValueError("`FileObject.file_path` must not be empty.")
with open(self.file_path, "rb") as file:
return file.read()

Expand Down

0 comments on commit 74f9fe9

Please sign in to comment.