@@ -145,7 +145,7 @@ def _normalize_parameters_for_capi(
145145 for key , value in list (normalized_params .items ()):
146146 if not isinstance (key , str ):
147147 msg = f"Parameter name must be of type string but got { type (key )} "
148- raise RuntimeError (msg )
148+ raise TypeError (msg )
149149
150150 if isinstance (value , (bytes , bytearray , memoryview )):
151151 binary = bytes (value )
@@ -157,11 +157,7 @@ def _normalize_parameters_for_capi(
157157
158158 def _is_python_scan_object (self , value : Any ) -> bool :
159159 module_name = type (value ).__module__
160- return (
161- module_name .startswith ("pandas" )
162- or module_name .startswith ("polars" )
163- or module_name .startswith ("pyarrow" )
164- )
160+ return module_name .startswith (("pandas" , "polars" , "pyarrow" ))
165161
166162 def _has_scan_pattern (self , query : str ) -> bool :
167163 stripped = query .lstrip ()
@@ -283,11 +279,7 @@ def _maybe_raise_scan_unsupported_object(self, query: str) -> None:
283279
284280 value = scope [var_name ]
285281 module_name = type (value ).__module__
286- if (
287- module_name .startswith ("pandas" )
288- or module_name .startswith ("polars" )
289- or module_name .startswith ("pyarrow" )
290- ):
282+ if module_name .startswith (("pandas" , "polars" , "pyarrow" )):
291283 return
292284
293285 msg = (
0 commit comments