polars icon indicating copy to clipboard operation
polars copied to clipboard

fix(python): Fix `pl.Series` 's dtype for pyarrow path

Open luke396 opened this issue 10 months ago • 1 comments

xref https://github.com/pola-rs/polars/pull/15948#issuecomment-2082792776 and a follow-up PR of #15948

Fix wrong dtype when create pl.Series from pd.Series.

when

print(pl.Series("foo", pd.Series([1, 2, 3], dtype='Int64'), pl.Float32))

before

shape: (3,)
Series: 'foo' [i64]
[
	1
	2
	3
]

after

shape: (3,)
Series: 'foo' [f32]
[
	1.0
	2.0
	3.0
]

luke396 avatar Apr 30 '24 06:04 luke396

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.98%. Comparing base (acb601d) to head (c000f20).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15962   +/-   ##
=======================================
  Coverage   80.97%   80.98%           
=======================================
  Files        1386     1386           
  Lines      178479   178479           
  Branches     2877     2877           
=======================================
+ Hits       144530   144539    +9     
+ Misses      33458    33448   -10     
- Partials      491      492    +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 30 '24 07:04 codecov[bot]

Thanks, @MarcoGorelli, for the quick review. I believe I now understand what you meant and have made the necessary changes.

luke396 avatar May 03 '24 08:05 luke396

  • a test where you convert from a pyarrow array with strict=False
  • a test where you convert from a pandas series with strict=False

I believe the change has been made

luke396 avatar May 04 '24 02:05 luke396

Thanks, @MarcoGorelli, for your patience and selfless help. This PR wouldn't have been completed without you!

luke396 avatar May 10 '24 03:05 luke396