Skip to content

Commit

Permalink
Backport PR #52332 on branch 2.0.x (Use date32 for pyarrow date) (#52350
Browse files Browse the repository at this point in the history
)

Backport PR #52332: Use date32 for pyarrow date

Co-authored-by: Ádám Lippai <adam@rigo.sk>
  • Loading branch information
mroeschke and alippai committed Apr 1, 2023
1 parent 055c4cd commit c922324
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ def _dt_second(self):

@property
def _dt_date(self):
return type(self)(self._data.cast(pa.date64()))
return type(self)(self._data.cast(pa.date32()))

@property
def _dt_time(self):
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2155,7 +2155,7 @@ def test_dt_properties(prop, expected):
result = getattr(ser.dt, prop)
exp_type = None
if isinstance(expected, date):
exp_type = pa.date64()
exp_type = pa.date32()
elif isinstance(expected, time):
exp_type = pa.time64("ns")
expected = pd.Series(ArrowExtensionArray(pa.array([expected, None], type=exp_type)))
Expand Down

0 comments on commit c922324

Please sign in to comment.