Skip to content

Commit

Permalink
Set force_overwrite to default to True #161
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Apr 4, 2024
1 parent 1fe44eb commit 86a6483
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pipestat/backends/db_backend/dbbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def report(
self,
values: Dict[str, Any],
record_identifier: str,
force_overwrite: bool = False,
force_overwrite: bool = True,
result_formatter: Optional[staticmethod] = None,
) -> Union[List[str], bool]:
"""
Expand Down
2 changes: 1 addition & 1 deletion pipestat/backends/file_backend/filebackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def report(
self,
values: Dict[str, Any],
record_identifier: Optional[str] = None,
force_overwrite: bool = False,
force_overwrite: bool = True,
result_formatter: Optional[staticmethod] = None,
) -> Union[List[str], bool]:
"""
Expand Down
2 changes: 1 addition & 1 deletion pipestat/pipestat.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def report(
self,
values: Dict[str, Any],
record_identifier: Optional[str] = None,
force_overwrite: bool = False,
force_overwrite: bool = True,
result_formatter: Optional[staticmethod] = None,
strict_type: bool = True,
) -> Union[List[str], bool]:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_pipestat.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,9 @@ def test_retrieve_one_single_result_as_list(
args.update(backend_data)
psm = SamplePipestatManager(**args)
psm.report(record_identifier=rec_id, values=val, force_overwrite=True)
assert psm.retrieve_one(record_identifier=rec_id, result_identifier="number_of_things") == psm.retrieve_one(record_identifier=rec_id, result_identifier=["number_of_things"])
assert psm.retrieve_one(
record_identifier=rec_id, result_identifier="number_of_things"
) == psm.retrieve_one(record_identifier=rec_id, result_identifier=["number_of_things"])

@pytest.mark.parametrize(
["rec_id", "val"],
Expand Down

0 comments on commit 86a6483

Please sign in to comment.