hgrecco / pint-pandas

Pandas support for pint
Other
166 stars 41 forks source link

"RuntimeWarning: pint-pandas does not..." is truncated #169

Closed kplanken closed 1 year ago

kplanken commented 1 year ago

When f.e. df.quantify, a RuntimeWarning is raised if it contains unsupported data types: " F:\A\repos\pint-pandas\pint_pandas\pint_array.py:225: RuntimeWarning: pint-pandas does not support magnitudes of int32. Converting magnitudes to float. warnings.warn( " The RuntimeWarning is truncated...

Possible solution:

Change: 227 warnings.warn( 228 f"pint-pandas does not support magnitudes of {values.dtype}. Converting magnitudes to float.", 229 category=RuntimeWarning, 230 )

To: 227 message = f"pint-pandas does not support magnitudes of {values.dtype}. Converting magnitudes to float." 228 warnings.warn(message, category=RuntimeWarning)

Then the message is fully shown.

andrewgsavage commented 1 year ago

a PR for this is welcome!

kplanken commented 1 year ago

Hi, I see this block has been changed so no need for a PR.. :-)