Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/system/small/operations/test_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,14 @@ def test_date_series_diff_agg(scalars_dfs):
pandas.testing.assert_series_equal(
actual_result, expected_result, check_index_type=False
)


def test_date_can_cast_after_accessor(scalars_dfs):
bf_df, pd_df = scalars_dfs

actual_result = bf_df.date_col.dt.isocalendar().week.astype("Int64").to_pandas()
expected_result = pd_df.date_col.dt.isocalendar().week.astype("Int64")

pandas.testing.assert_series_equal(
actual_result, expected_result, check_dtype=False, check_index_type=False
)
11 changes: 11 additions & 0 deletions tests/system/small/operations/test_datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,3 +603,14 @@ def test_to_datetime(scalars_dfs, col):
testing.assert_series_equal(
actual_result, expected_result, check_dtype=False, check_index_type=False
)


def test_timedelta_can_cast_after_dt_accessor(timedelta_series):
bf_s, pd_s = timedelta_series

actual_result = bf_s.dt.isocalendar().week.astype("Int64").to_pandas()
expected_result = pd_s.dt.isocalendar().week.astype("Int64")

assert_series_equal(
actual_result, expected_result, check_dtype=False, check_index_type=False
)
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,14 @@ class ExtractFragment(ExtractURLField):
class StringLength(StringUnary):
"""Compute the length of a string."""

dtype = dt.int32
dtype = dt.int64


@public
class StringAscii(StringUnary):
"""Compute the ASCII code of the first character of a string."""

dtype = dt.int32
dtype = dt.int64


@public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ExtractTemporalField(Unary):
"""Extract a field from a temporal value."""

arg: Value[dt.Temporal]
dtype = dt.int32
dtype = dt.int64


@public
Expand Down