Eventual-Inc / Daft

Distributed DataFrame for Python designed for the cloud, powered by Rust
https://getdaft.io
Apache License 2.0
1.71k stars 98 forks source link

Improve dt.hour() expression #2086

Open colin-ho opened 4 weeks ago

colin-ho commented 4 weeks ago

Currently, the dt.hour() expression only works on Datetime columns. We should allow this to work on Time columns as well.

Example of desired behaviour:

import daft
import datetime

df = daft.from_pydict({"data":[datetime.datetime.now().time()]})
df = df.select(df["data"].dt.hour())
df = df.collect()
print(df)

Also, the docstrings for the dt.hour expression should be fixed as well.

KekmaTime commented 3 weeks ago

@colin-ho i would like to work on this issue

colin-ho commented 3 weeks ago

Awesome, assigning this to you, thanks @KekmaTime !!