Skip to content

Commit

Permalink
update temporal_test.py, prediction_times.py and utils_for_testing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBernstorff committed Jun 12, 2024
1 parent 194418b commit 2181eff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/timeseriesflattener/processors/temporal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_slice_without_any_within_window():
result.get_column("pred_is_null_within_0_to_2_days"),
timedelta_frame.df.collect().get_column("is_null"),
check_names=False,
check_dtype=False,
check_dtypes=False,
)


Expand Down
2 changes: 1 addition & 1 deletion src/timeseriesflattener/specs/prediction_times.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __post_init__(
else:
self.df: pl.LazyFrame = init_df # type: ignore

self.df = self.df.with_columns(
self.df = self.df.with_columns( # type: ignore
pl.concat_str(
pl.col(self.entity_id_col_name), pl.lit("-"), pl.col(self.timestamp_col_name)
).alias(self.prediction_time_uuid_col_name)
Expand Down
7 changes: 4 additions & 3 deletions src/timeseriesflattener/testing/utils_for_testing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for testing."""

from __future__ import annotations

from io import StringIO
Expand Down Expand Up @@ -121,15 +122,15 @@ def assert_flattened_data_as_expected(
if expected_df:
for col in expected_df.columns:
assert_series_equal(
left=flattened_ds.get_df()[col], right=expected_df[col], check_dtype=False
)
left=flattened_ds.get_df()[col], right=expected_df[col], check_dtypes=False
) # type: ignore
elif expected_values:
output_df = flattened_ds.get_df()
value_cols = _get_value_cols_based_on_spec(output_df, output_spec)
output = pd.Series(output_df[value_cols].values)
expected = pd.Series(expected_values)

assert_series_equal(output, expected, check_dtype=False)
assert_series_equal(output, expected, check_dtypes=False) # type: ignore
else:
raise ValueError("Must provide an expected set of data")

Expand Down

0 comments on commit 2181eff

Please sign in to comment.