File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,13 @@ def filter_values_handler( # pylint: disable=too-many-arguments # noqa: C901
528
528
def handle_single_value (value : FilterValue | None ) -> FilterValue | None :
529
529
if operator == utils .FilterOperator .TEMPORAL_RANGE :
530
530
return value
531
+
532
+ if (
533
+ isinstance (value , (float , int ))
534
+ and target_generic_type == utils .GenericDataType .NUMERIC
535
+ ):
536
+ value = float (value )
537
+
531
538
if (
532
539
isinstance (value , (float , int ))
533
540
and target_generic_type == utils .GenericDataType .TEMPORAL
@@ -553,7 +560,11 @@ def handle_single_value(value: FilterValue | None) -> FilterValue | None:
553
560
):
554
561
# For backwards compatibility and edge cases
555
562
# where a column data type might have changed
556
- return utils .cast_to_num (value )
563
+ try :
564
+ return utils .cast_to_num (float (value ))
565
+ except ValueError :
566
+ logger .error (f"Unable to cast value { value } to num" )
567
+ return utils .cast_to_num (value )
557
568
if value == NULL_STRING :
558
569
return None
559
570
if value == EMPTY_STRING :
You can’t perform that action at this time.
0 commit comments