Skip to content

Commit

Permalink
empty dataframy bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
omelyanchikd committed Jan 7, 2025
1 parent f63ec91 commit 5754179
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdv/data_processing/data_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,8 @@ def filter_valid(self, data):
Table containing only the valid rows.
"""
for constraint in self._constraints:
if data.empty:
return data
data = constraint.filter_valid(data)

return data
Expand Down
2 changes: 2 additions & 0 deletions sdv/single_table/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ def _filter_conditions(sampled, conditions, float_rtol):
pandas.DataFrame:
Rows from the sampled data that match the conditions.
"""
if sampled.empty:
return sampled
for column, value in conditions.items():
column_values = sampled[column]
if column_values.dtype.kind == 'f':
Expand Down

0 comments on commit 5754179

Please sign in to comment.