Skip to content

Commit

Permalink
fix casting with empty dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
nonibansal committed Dec 16, 2024
1 parent da2ebca commit e26d175
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions fennel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [1.5.62] - 2024-12-16
- Fix casting for empty dataframes.

## [1.5.61] - 2024-12-12
- Add appropriate warnings for aggregations on top of keyed datasets.

Expand Down
2 changes: 1 addition & 1 deletion fennel/testing/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def join_aggregated_dataset(

for col in key_dfs.columns:
# If any of the columns is a dictionary, convert it to a frozen dict
if key_dfs[col].apply(lambda x: isinstance(x, dict)).any():
if any([isinstance(x, dict) for x in key_dfs[col].tolist()]):
key_dfs[col] = key_dfs[col].apply(lambda x: frozendict(x))

# Find the values for all columns as of the timestamp in key_dfs
Expand Down
4 changes: 3 additions & 1 deletion fennel/testing/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ def add_deletes(
last_index_for_key[key] = i

# Add the delete timestamp as a hidden column to the dataframe
sorted_df[FENNEL_DELETE_TIMESTAMP] = delete_timestamps
sorted_df[FENNEL_DELETE_TIMESTAMP] = pd.Series(
delete_timestamps, dtype=pd.ArrowDtype(pa.timestamp("ns", "UTC"))
)

if len(rows_to_delete) > 0:
# Drop the rows that are marked for deletion
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fennel-ai"
version = "1.5.61"
version = "1.5.62"
description = "The modern realtime feature engineering platform"
authors = ["Fennel AI <[email protected]>"]
packages = [{ include = "fennel" }]
Expand Down

0 comments on commit e26d175

Please sign in to comment.