Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/test_core/test_filter/test_feature_group_final_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,3 +689,29 @@ def test_numeric_filter_on_string_column_raises_error(
flight_server=flight_server,
global_filter=global_filter,
)

def test_compatible_dtype_passes_validation(self, modes: set[ParallelizationMode], flight_server: Any) -> None:
"""FG=True with compatible numeric dtypes. No error should be raised.

CompatibleDtypeFeatureGroup returns final_filters()=True and the
"rank" column is integer (int64), matching the integer filter value
type (rank == 1). Row elimination should proceed normally.
"""
feature_name = "CompatibleDtypeFeatureGroup"

features = Features([Feature(name=feature_name, initial_requested_data=True)])

global_filter = GlobalFilter()
global_filter.add_filter("rank", "equal", {"value": 1})

result = MlodaTestRunner.run_api(
features,
compute_frameworks={PyArrowTable},
parallelization_modes=modes,
flight_server=flight_server,
global_filter=global_filter,
)

for res in result.results:
data = res.to_pydict()
assert data[feature_name] == [10, 30]
Loading