Skip to content

Implementing More Datetime Primitives#2117

Merged
sbadithe merged 16 commits intomainfrom
add-more-datetime-primitives
Jun 17, 2022
Merged

Implementing More Datetime Primitives#2117
sbadithe merged 16 commits intomainfrom
add-more-datetime-primitives

Conversation

@sbadithe
Copy link
Contributor

@sbadithe sbadithe commented Jun 16, 2022

Working on adding more datetime primitives:

  • DaysInMonth (issue#2067)
  • Quarter (issue#2066)
  • IsLeapYear (issue#2066)
  • IsQuarterEnd (issue#2065)
  • IsQuarterStart (issue#2064)

@sbadithe sbadithe changed the title DaysInMonth primitive Implementing More Datetime Primitives Jun 16, 2022
@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #2117 (a22c9bd) into main (656b50d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2117   +/-   ##
=======================================
  Coverage   99.20%   99.20%           
=======================================
  Files         143      143           
  Lines       16585    16665   +80     
=======================================
+ Hits        16453    16533   +80     
  Misses        132      132           
Impacted Files Coverage Δ
...imitives/standard/datetime_transform_primitives.py 100.00% <100.00%> (ø)
.../tests/primitive_tests/test_transform_primitive.py 100.00% <100.00%> (ø)

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 656b50d...a22c9bd. Read the comment docs.

@sbadithe sbadithe marked this pull request as ready for review June 17, 2022 00:45
Comment on lines +9 to +14
* Implement ``DaysInMonth`` primitive (:pr:`2117`)
* Implement ``Quarter`` primitive (:pr:`2117`)
* Implement ``IsLeapYear`` primitive (:pr:`2117`)
* Implement ``IsQuarterEnd`` primitive (:pr:`2117`)
* Implement ``IsQuarterStart`` primitive (:pr:`2117`)
* Implement ``DayOfYear`` primitive (:pr:`2110`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Implement ``DaysInMonth`` primitive (:pr:`2117`)
* Implement ``Quarter`` primitive (:pr:`2117`)
* Implement ``IsLeapYear`` primitive (:pr:`2117`)
* Implement ``IsQuarterEnd`` primitive (:pr:`2117`)
* Implement ``IsQuarterStart`` primitive (:pr:`2117`)
* Implement ``DayOfYear`` primitive (:pr:`2110`)
* Add ``DaysInMonth``, ``Quarter`` , ``IsLeapYear`` , ``IsQuarterEnd`` , ``IsQuarterStart``, ``DayOfYear`` transform primitives (:pr:`2110`)

@gsheni
Copy link
Contributor

gsheni commented Jun 17, 2022

Do we need to worry about timezone aware datetimes with any of these primitives?

@sbadithe
Copy link
Contributor Author

Do we need to worry about timezone aware datetimes with any of these primitives?

I do not believe so

@gsheni gsheni requested a review from dvreed77 June 17, 2022 18:57

def test_days_in_month():
dim = DaysInMonth()
dates = pd.Series([datetime(2010, 1, 1)])
Copy link
Contributor

Choose a reason for hiding this comment

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

add more test cases. Add february of leap year and not leap year

Copy link
Contributor

@dvreed77 dvreed77 left a comment

Choose a reason for hiding this comment

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

lgtm

@sbadithe sbadithe merged commit f2caef0 into main Jun 17, 2022
@sbadithe sbadithe deleted the add-more-datetime-primitives branch June 17, 2022 20:47
@sbadithe sbadithe mentioned this pull request Jun 23, 2022
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