Skip to content

Commit

Permalink
chore(pandas-data): decimal conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Dec 6, 2023
1 parent 066a416 commit d978322
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ibis/formats/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def convert_Boolean(s, dtype, pandas_type):
else:
return s

@staticmethod
def convert_Decimal(s, dtype, pandas_type):
import decimal

import pyarrow as pa

arr = pa.array(s.map(decimal.Decimal, na_action="ignore").values)
return arr.cast(dtype.to_pyarrow(), safe=False)

@staticmethod
def convert_Timestamp(s, dtype, pandas_type):
if isinstance(dtype, pd.DatetimeTZDtype):
Expand Down

0 comments on commit d978322

Please sign in to comment.