-
Notifications
You must be signed in to change notification settings - Fork 71
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
Resolve test_date_functions()
#813
Resolve test_date_functions()
#813
Conversation
sarahyurick
commented
Sep 27, 2022
- Extract microseconds/millennium/millisecond
- Last_day
- Timestampadd
- Ceil
- Floor
fn parse_prefix(&self, parser: &mut Parser) -> Option<Result<Expr, ParserError>> { | ||
fn parse_expr(parser: &mut Parser) -> Result<Option<Expr>, ParserError> { | ||
match parser.peek_token() { | ||
Token::Word(w) if w.value.to_lowercase() == "timestampadd" => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #857
Codecov Report
@@ Coverage Diff @@
## main #813 +/- ##
==========================================
+ Coverage 75.91% 76.64% +0.72%
==========================================
Files 73 73
Lines 4082 4115 +33
Branches 739 751 +12
==========================================
+ Hits 3099 3154 +55
+ Misses 823 786 -37
- Partials 160 175 +15
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
test_date_functions()
test_date_functions()
Co-authored-by: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sarahyurick! Overall LGTM, just some small nitpicks
Co-authored-by: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com>
for date in df: | ||
year = date.year + interval | ||
# Check leap day | ||
if year % 4 != 0 and date.month == 2 and date.day == 29: | ||
result.append(date.replace(year=year, month=3, day=1)) | ||
else: | ||
result.append(date.replace(year=year)) | ||
return pd.Series(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an alternative approach that can achieve this without iterating over each row individually and specifically return a pandas series?