diff --git a/h5grove/encoders.py b/h5grove/encoders.py index f054e99..4d20fe1 100644 --- a/h5grove/encoders.py +++ b/h5grove/encoders.py @@ -111,10 +111,6 @@ def encode(content: Any, encoding: Optional[str] = "json") -> Response: ) content_array = np.array(content, copy=False) - if not is_numeric_data(content_array): - raise QueryArgumentError( - f"Unsupported encoding {encoding} for non-numeric content" - ) if encoding == "bin": return Response( @@ -124,6 +120,11 @@ def encode(content: Any, encoding: Optional[str] = "json") -> Response: }, ) + if not is_numeric_data(content_array): + raise QueryArgumentError( + f"Unsupported encoding {encoding} for non-numeric content" + ) + if encoding == "csv": return Response( csv_encode(content_array),