Skip to content

Commit

Permalink
Remove cudf._lib.timezone in favor of inlining pylibcudf (#17366)
Browse files Browse the repository at this point in the history
Contributes to #17317

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - James Lamb (https://github.com/jameslamb)
  - Bradley Dice (https://github.com/bdice)

URL: #17366
  • Loading branch information
mroeschke authored Nov 26, 2024
1 parent 4e3afd2 commit ccc8833
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
1 change: 0 additions & 1 deletion python/cudf/cudf/_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ set(cython_sources
string_casting.pyx
strings_udf.pyx
text.pyx
timezone.pyx
transform.pyx
types.pyx
utils.pyx
Expand Down
1 change: 0 additions & 1 deletion python/cudf/cudf/_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
strings,
strings_udf,
text,
timezone,
)

MAX_COLUMN_SIZE = np.iinfo(np.int32).max
Expand Down
10 changes: 0 additions & 10 deletions python/cudf/cudf/_lib/timezone.pyx

This file was deleted.

11 changes: 8 additions & 3 deletions python/cudf/cudf/core/_internals/timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
import numpy as np
import pandas as pd

import pylibcudf as plc

import cudf
from cudf._lib.timezone import make_timezone_transition_table
from cudf._lib.column import Column

if TYPE_CHECKING:
from cudf.core.column.datetime import DatetimeColumn
Expand Down Expand Up @@ -109,11 +111,14 @@ def _find_and_read_tzfile_tzdata(


def _read_tzfile_as_columns(
tzdir, zone_name: str
tzdir: str, zone_name: str
) -> tuple[DatetimeColumn, TimeDeltaColumn]:
transition_times_and_offsets = make_timezone_transition_table(
plc_table = plc.io.timezone.make_timezone_transition_table(
tzdir, zone_name
)
transition_times_and_offsets = [
Column.from_pylibcudf(col) for col in plc_table.columns()
]

if not transition_times_and_offsets:
from cudf.core.column.column import as_column
Expand Down

0 comments on commit ccc8833

Please sign in to comment.