Skip to content

Commit

Permalink
Relaxed the validation of the filter values.
Browse files Browse the repository at this point in the history
  • Loading branch information
KFilippopolitis committed Apr 16, 2024
1 parent d350381 commit 5ea3f1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion exareme2/data_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ def _check_value_type(column: str, value, cdes):
def _check_value_column_same_type(column, value, cdes):
column_sql_type = cdes[column].sql_type
dtype = DType.from_cde(column_sql_type)
if type(value) is not dtype.to_py():
try:
value = dtype.to_py()(value)
except ValueError:
raise FilterError(
f"{column}'s type: {column_sql_type} was different from the type of the given value:{type(value)}"
)

0 comments on commit 5ea3f1e

Please sign in to comment.