diff --git a/python/pyspark/sql/pandas/types.py b/python/pyspark/sql/pandas/types.py index cfcca827fffee..2e23d304d8cb6 100644 --- a/python/pyspark/sql/pandas/types.py +++ b/python/pyspark/sql/pandas/types.py @@ -1277,7 +1277,7 @@ def correct_timestamp(pser: pd.Series) -> pd.Series: # lambda x: Decimal(x))).cast(pa.decimal128(1)) def convert_int_to_decimal(pser: pd.Series) -> pd.Series: - if pser.dtype.kind in ["i", "u"]: + if pd.api.types.is_integer_dtype(pser): # type: ignore[attr-defined] return pser.apply( # type: ignore[return-value] lambda x: Decimal(x) if pd.notna(x) else None )