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 properties for DatetimeIndex #2074

Merged

Conversation

xinrong-meng
Copy link
Contributor

@xinrong-meng xinrong-meng commented Mar 2, 2021

The PR is proposed to add properties for DatetimeIndex. The added properties follow datetimelike properties of the Series values.

hour = _unsupported_property("hour", cls="DatetimeIndex")
minute = _unsupported_property("minute", cls="DatetimeIndex")
second = _unsupported_property("second", cls="DatetimeIndex")
microsecond = _unsupported_property("microsecond", cls="DatetimeIndex")
nanosecond = _unsupported_property("nanosecond", cls="DatetimeIndex")
Copy link
Contributor Author

@xinrong-meng xinrong-meng Mar 2, 2021

Choose a reason for hiding this comment

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

Properties that are still missing would be implemented in follow-up PRs.
We don't implement them in datetimelike properties of the Series values, either.

@codecov-io
Copy link

codecov-io commented Mar 2, 2021

Codecov Report

Merging #2074 (a3c1fad) into master (f229f74) will decrease coverage by 0.78%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2074      +/-   ##
==========================================
- Coverage   94.68%   93.89%   -0.79%     
==========================================
  Files          55       55              
  Lines       11747    11802      +55     
==========================================
- Hits        11123    11082      -41     
- Misses        624      720      +96     
Impacted Files Coverage Δ
databricks/koalas/missing/indexes.py 100.00% <ø> (ø)
databricks/koalas/indexes/datetimes.py 98.09% <100.00%> (+5.23%) ⬆️
databricks/koalas/usage_logging/__init__.py 26.66% <0.00%> (-65.84%) ⬇️
databricks/koalas/usage_logging/usage_logger.py 47.82% <0.00%> (-52.18%) ⬇️
databricks/koalas/__init__.py 88.00% <0.00%> (-4.00%) ⬇️
databricks/conftest.py 97.10% <0.00%> (-2.90%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f229f74...a3c1fad. Read the comment docs.

Copy link
Collaborator

@ueshin ueshin left a comment

Choose a reason for hiding this comment

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

Could you also update docs/source/reference/indexing.rst?

databricks/koalas/tests/test_indexes.py Outdated Show resolved Hide resolved
@xinrong-meng
Copy link
Contributor Author

Could you also update docs/source/reference/indexing.rst?

Sounds good! Updated.

Copy link
Collaborator

@ueshin ueshin left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM.

databricks/koalas/tests/test_indexes.py Outdated Show resolved Hide resolved
databricks/koalas/tests/test_indexes.py Outdated Show resolved Hide resolved
databricks/koalas/tests/test_indexes.py Outdated Show resolved Hide resolved
@xinrong-meng xinrong-meng merged commit 66d3c1b into databricks:master Mar 3, 2021
@xinrong-meng
Copy link
Contributor Author

Merged! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants