Skip to content

Commit

Permalink
fixed final unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan2Y79 committed Nov 15, 2024
1 parent 74e7353 commit 6e0a898
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/freezing/freezing_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Utility functions for the freezing module."""
from datetime import datetime
from typing import Tuple, Dict

import pandas as pd

from src.utils.defence import type_defence
Expand All @@ -19,7 +17,7 @@ def _add_last_frozen_column(frozen_df: pd.DataFrame,
pd.DataFrame: A dataframe containing the updated last_frozen column.
"""
type_defence(frozen_df, "frozen_df", pd.DataFrame)
type_defence(config, "run_id", Dict)
type_defence(config, "run_id", dict)
todays_date = datetime.today().strftime("%y-%m-%d")
run_id = config["filename_items"]["run_id"]
last_frozen = f"{todays_date}_v{str(run_id)}"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_freezing/test_freezing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test__add_last_frozen_column(self):
{"test": [0]}
)
# add last_frozen_column
last_frozen_df = _add_last_frozen_column(dummy_df, 7000)
last_frozen_df = _add_last_frozen_column(dummy_df, {"filename_items": {"run_id": "7000"}})
exp_last_frozen = self.create_expected_last_frozen(7000)
assert len(last_frozen_df.last_frozen.unique()) == 1, (
"_add_last_frozen_column has added multiple different values."
Expand Down

0 comments on commit 6e0a898

Please sign in to comment.