File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -452,7 +452,7 @@ Changelog
452452 :user: `Jérémie du Boisberranger <jeremiedbb> `.
453453
454454- |FIX | Fixes :func: `utils.validation.check_array ` to properly convert pandas
455- extension arrays. :pr: `25813 ` by `Thomas Fan `_.
455+ extension arrays. :pr: `25813 ` and :pr: ` 26106 ` by `Thomas Fan `_.
456456
457457- |Fix | :func: `utils.validation.check_array ` now suports pandas DataFrames with
458458 extension arrays and object dtypes by return an ndarray with object dtype.
Original file line number Diff line number Diff line change @@ -628,12 +628,8 @@ def _pandas_dtype_needs_early_conversion(pd_dtype):
628628
629629
630630def _is_extension_array_dtype (array ):
631- try :
632- from pandas .api .types import is_extension_array_dtype
633-
634- return is_extension_array_dtype (array )
635- except ImportError :
636- return False
631+ # Pandas extension arrays have a dtype with an na_value
632+ return hasattr (array , "dtype" ) and hasattr (array .dtype , "na_value" )
637633
638634
639635def check_array (
You can’t perform that action at this time.
0 commit comments