Skip to content

Commit

Permalink
Fix pyarrow for old pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
fealho committed Oct 9, 2024
1 parent 3e9bd7a commit cbe1abf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rdt/transformers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ def learn_rounding_digits(data):
int or None:
Number of digits to round to.
"""
name = data.name
if isinstance(data.dtype, pd.ArrowDtype):
if str(data.dtype).endswith("[pyarrow]"):
data = data.to_numpy()

# check if data has any decimals
Expand All @@ -276,7 +275,7 @@ def learn_rounding_digits(data):
# Can't round, not equal after MAX_DECIMALS digits of precision
LOGGER.info(
"No rounding scheme detected for column '%s'. Data will not be rounded.",
name,
data.name,
)
return None

Expand Down

0 comments on commit cbe1abf

Please sign in to comment.