Skip to content

Commit

Permalink
bug: add infered integer to pandas type cast and default to decimal (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dhercher committed Aug 25, 2022
1 parent e67de5b commit 68e5058
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion third_party/ibis/ibis_addon/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
# mixed-integer-float, complex, categorical, timedelta64, timedelta, period
IBIS_TYPE_TO_PANDAS_TYPE[dt.Decimal(10, 0)] = np.dtype(decimal.Decimal)
_inferable_pandas_dtypes["decimal"] = dt.Decimal(10, 0)
_inferable_pandas_dtypes["integer"] = dt.int32

_inferable_pandas_dtypes["date"] = dt.date
_inferable_pandas_dtypes["datetime64"] = dt.timestamp
Expand Down Expand Up @@ -86,7 +87,7 @@ def infer_pandas_schema_incl_decimals(df, schema=None):
)
elif inferred_dtype == "floating":
inferred_dtype = "decimal"
ibis_dtype = _inferable_pandas_dtypes[inferred_dtype]
ibis_dtype = _inferable_pandas_dtypes.get(inferred_dtype, dt.Decimal(10, 0))
else:
ibis_dtype = dt.dtype(pandas_dtype)

Expand Down

0 comments on commit 68e5058

Please sign in to comment.