Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing tests for datetime & Remove unsupported property #729

Merged
merged 2 commits into from
Sep 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 0 additions & 8 deletions databricks/koalas/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ def second(self) -> 'ks.Series':
"""
return _wrap_accessor_spark(self, F.second, LongType()).alias(self.name)

@property
def millisecond(self) -> 'ks.Series':
"""
The milliseconds of the datetime.
"""
return _wrap_accessor_pandas(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we remove this? Does this not work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HyukjinKwon, Thanks to Review.
I thought these were the reuses of the Pandas Series dt Property.
However, in the screenshots I added to PR, the Pandas Series dt Property does not support milliseconds.
So I thought this was probably added by mistake.
And It doesn't actually work as you asked, (as in the following screenshot.)

스크린샷 2019-09-01 오후 2 06 51

self, lambda x: x.dt.millisecond, LongType()).alias(self.name)

@property
def microsecond(self) -> 'ks.Series':
"""
Expand Down
3 changes: 3 additions & 0 deletions databricks/koalas/tests/test_series_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def test_weekofyear(self):
def test_dayofweek(self):
self.check_func(lambda x: x.dt.dayofweek)

def test_weekday(self):
self.check_func(lambda x: x.dt.weekday)

def test_dayofyear(self):
self.check_func(lambda x: x.dt.dayofyear)

Expand Down
1 change: 0 additions & 1 deletion docs/source/reference/series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ Datetime Properties
Series.dt.hour
Series.dt.minute
Series.dt.second
Series.dt.millisecond
Series.dt.microsecond
Series.dt.week
Series.dt.weekofyear
Expand Down