Skip to content

Commit

Permalink
🚧 specific test for seialisation for DateTimeInfoExtractor
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhopkinson26 committed Jun 27, 2024
1 parent a42916a commit 8bb467c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/dates/test_DateTimeInfoExtractor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import joblib
import numpy as np
import pandas as pd
import pytest
Expand Down Expand Up @@ -391,3 +392,17 @@ def test_correct_df_returned_datetime_input(self):
expected,
"incorrect dataframe returned",
)

def test_is_serialisable(self, tmpdir):
x = DatetimeInfoExtractor(columns=["b"], include=["timeofyear"])
expected = x

# pickle transformer
path = tmpdir.join("transformer.pkl")

joblib.dump(x, path)

# unpickle
actual = joblib.load(tmpdir.join("transformer.pkl"))

assert actual == expected

0 comments on commit 8bb467c

Please sign in to comment.