Skip to content

Commit

Permalink
feat(polars): add TimeFromHMS op
Browse files Browse the repository at this point in the history
  • Loading branch information
IndexSeek committed Dec 31, 2024
1 parent 56a66de commit acd3495
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ibis/backends/polars/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,15 @@ def execute_timestamp_range(op, **kw):
return pl.datetime_ranges(start, stop, f"{step}{unit}", closed="left")


@translate.register(ops.TimeFromHMS)
def execute_time_from_hms(op, **kw):
return pl.time(
hour=translate(op.hours, **kw),
minute=translate(op.minutes, **kw),
second=translate(op.seconds, **kw),
)


@translate.register(ops.DropColumns)
def execute_drop_columns(op, **kw):
parent = translate(op.parent, **kw)
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/tests/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ def test_timestamp_with_timezone_literal(con, timezone, expected):


@pytest.mark.notimpl(
["datafusion", "pyspark", "polars", "mysql", "oracle", "databricks"],
["datafusion", "pyspark", "mysql", "oracle", "databricks"],
raises=com.OperationNotDefinedError,
)
@pytest.mark.notyet(
Expand Down

0 comments on commit acd3495

Please sign in to comment.