Skip to content

Commit

Permalink
fix: test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mats E. Mollestad committed Nov 9, 2023
1 parent 4de5621 commit 450a6a8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
3 changes: 1 addition & 2 deletions aligned/schemas/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ def gracefull_transformation(
transformation: Callable[[pd.Series], pd.Series],
) -> pd.Series:
result = pd.Series(np.repeat(np.nan, repeats=is_valid_mask.shape[0]))
result.loc[is_valid_mask] = transformation(df.loc[is_valid_mask])
return result
return result.mask(is_valid_mask, transformation(df.loc[is_valid_mask]))


class PsqlTransformation:
Expand Down
21 changes: 3 additions & 18 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,7 @@ class TitanicPassenger(FeatureView):
sex = String().accepted_values(['male', 'female'])
survived = Bool().description('If the passenger survived')

sibsp = (
Int32()
.lower_bound(0, is_inclusive=True)
.upper_bound(20, is_inclusive=True)
.description('Number of siblings on titanic')
)
sibsp = Int32().lower_bound(0).upper_bound(20).description('Number of siblings on titanic')

cabin = String()

Expand Down Expand Up @@ -480,12 +475,7 @@ class TitanicPassenger(FeatureView):
sex = String().accepted_values(['male', 'female'])
survived = Bool().description('If the passenger survived')

sibsp = (
Int32()
.lower_bound(0, is_inclusive=True)
.upper_bound(20, is_inclusive=True)
.description('Number of siblings on titanic')
)
sibsp = Int32().lower_bound(0).upper_bound(20).description('Number of siblings on titanic')

cabin = String()

Expand Down Expand Up @@ -616,12 +606,7 @@ class TitanicPassenger(FeatureView):
embedding_size=50, storage=redis.index(name='name_embedding_index'), metadata=[age, sex]
)

sibsp = (
Int32()
.lower_bound(0, is_inclusive=True)
.upper_bound(20, is_inclusive=True)
.description('Number of siblings on titanic')
)
sibsp = Int32().lower_bound(0).upper_bound(20).description('Number of siblings on titanic')

double_sibsp = sibsp * 2
square_sibsp = sibsp * sibsp
Expand Down
Loading

0 comments on commit 450a6a8

Please sign in to comment.