Skip to content

Commit

Permalink
Added init validation for the padding transformer
Browse files Browse the repository at this point in the history
Signed-off-by: mboussarov <[email protected]>
  • Loading branch information
mboussarov committed Jun 11, 2024
1 parent 38a53c6 commit 8d4f485
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions numalogic/transforms/_stateless.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def __init__(self, features: list[str], flatten_features: list[str], padding_wit
self.padding_with = padding_with

self.padding_features = list(set(features) - set(flatten_features))
if not self.padding_features:
raise ValueError("At least one feature should be left for padding.")

Check warning on line 192 in numalogic/transforms/_stateless.py

View check run for this annotation

Codecov / codecov/patch

numalogic/transforms/_stateless.py#L192

Added line #L192 was not covered by tests
self.flatten_indexes = self._feature_indexes(features, self.flatten_features)
self.padding_indexes = self._feature_indexes(features, self.padding_features)

Expand Down

0 comments on commit 8d4f485

Please sign in to comment.