Skip to content

Support cudf-polars epoch - #18443

Merged
rapids-bot[bot] merged 9 commits into
NVIDIA:mainfrom
brandon-b-miller:fea-cudf-polars-epoch
Jun 24, 2026
Merged

Support cudf-polars epoch#18443
rapids-bot[bot] merged 9 commits into
NVIDIA:mainfrom
brandon-b-miller:fea-cudf-polars-epoch

Conversation

@brandon-b-miller

@brandon-b-miller brandon-b-miller commented Apr 5, 2025

Copy link
Copy Markdown
Contributor

Part of #16481

@brandon-b-miller brandon-b-miller added feature request New feature or request non-breaking Non-breaking change cudf-polars Issues specific to cudf-polars labels Apr 5, 2025
@brandon-b-miller
brandon-b-miller requested a review from a team as a code owner April 5, 2025 02:16
@github-actions github-actions Bot added the Python Affects Python cuDF API. label Apr 5, 2025
@vyasr

vyasr commented May 7, 2025

Copy link
Copy Markdown
Contributor

@brandon-b-miller what's the status on this PR?

@brandon-b-miller
brandon-b-miller requested review from a team as code owners June 22, 2026 11:25
@brandon-b-miller
brandon-b-miller requested review from kingcrimsontianyu and removed request for a team June 22, 2026 11:25
@GPUtester GPUtester moved this to In Progress in cuDF Python Jun 22, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@brandon-b-miller
brandon-b-miller changed the base branch from branch-25.06 to release/26.06 June 22, 2026 11:26
@brandon-b-miller
brandon-b-miller requested review from a team as code owners June 22, 2026 11:26
@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue pylibcudf Issues specific to the pylibcudf package labels Jun 22, 2026
@brandon-b-miller
brandon-b-miller changed the base branch from release/26.06 to main June 22, 2026 11:26
@brandon-b-miller
brandon-b-miller removed request for a team June 22, 2026 11:27
@brandon-b-miller
brandon-b-miller removed request for a team and kingcrimsontianyu June 22, 2026 11:27
Comment thread python/cudf_polars/cudf_polars/dsl/expressions/datetime.py Outdated
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 33283c51-79a4-4b12-b044-91f3bea9fc57

📥 Commits

Reviewing files that changed from the base of the PR and between 259cc88 and 12de897.

📒 Files selected for processing (1)
  • python/cudf_polars/cudf_polars/dsl/expressions/datetime.py
💤 Files with no reviewable changes (1)
  • python/cudf_polars/cudf_polars/dsl/expressions/datetime.py

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Enhanced datetime/timestamp epoch conversion to support additional time_unit resolutions: milliseconds, microseconds, nanoseconds, seconds, and days (including Date and Datetime inputs).
  • Tests

    • Added GPU-validated, parametrized test coverage for epoch operations across multiple datetime-like dtypes and time_unit values (ms, us, ns, s, d).

Walkthrough

Adds TimeStamp support to the TemporalFunction DSL in the cudf-polars GPU expression evaluator. The implementation registers the op in _valid_ops, adds imports for polars and DataType, and inserts an evaluation branch that rescales the input column via an intermediate pl.Datetime(time_unit) cast before casting to the final output dtype. A new parametrized test_epoch test validates the feature across multiple datetime dtypes and time units.

Changes

TemporalFunction TimeStamp Support

Layer / File(s) Summary
TimeStamp implementation in TemporalFunction
python/cudf_polars/cudf_polars/dsl/expressions/datetime.py
Adds polars and DataType imports, registers Name.TimeStamp in _valid_ops, and inserts a do_evaluate branch that evaluates the child column, rescales it to pl.Datetime(time_unit) via intermediate cast, and then casts to the expression's output dtype.
test_epoch parametrized test
python/cudf_polars/tests/expressions/test_datetime_basic.py
Adds test_epoch covering pl.Date and pl.Datetime("ms"/"us"/"ns") dtypes with time_unit values "s", "d", "ms", "us", "ns", asserting GPU results via assert_gpu_result_equal.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Support cudf-polars epoch' accurately describes the main change: adding epoch functionality support to the cudf-polars module.
Description check ✅ Passed The PR description references issue #16481 and indicates this is part of a larger effort to support epoch functionality in cudf-polars, which is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Comment thread python/cudf_polars/cudf_polars/dsl/expressions/datetime.py Outdated
brandon-b-miller and others added 2 commits June 22, 2026 16:38
Co-authored-by: Matthew Murray <41342305+Matt711@users.noreply.github.com>
Comment thread python/cudf_polars/cudf_polars/dsl/expressions/datetime.py Outdated
@brandon-b-miller

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 6a9ac65 into NVIDIA:main Jun 24, 2026
201 of 203 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python Jun 24, 2026
@brandon-b-miller
brandon-b-miller deleted the fea-cudf-polars-epoch branch June 24, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake CMake build issue cudf-polars Issues specific to cudf-polars feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants