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

Resolve test_date_functions() #813

Merged
merged 21 commits into from
Dec 2, 2022

Conversation

sarahyurick
Copy link
Collaborator

  • 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" => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From #857

@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2022

Codecov Report

Merging #813 (406824c) into main (cf719c5) will increase coverage by 0.72%.
The diff coverage is 78.94%.

@@            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     
Impacted Files Coverage Δ
dask_sql/physical/rex/core/call.py 88.58% <78.94%> (+7.08%) ⬆️
dask_sql/physical/rex/core/literal.py 58.09% <0.00%> (-2.86%) ⬇️
dask_sql/physical/rel/custom/export_model.py 88.88% <0.00%> (-2.78%) ⬇️
dask_sql/physical/rel/logical/window.py 95.37% <0.00%> (-1.74%) ⬇️
dask_sql/_version.py 32.76% <0.00%> (-1.13%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sarahyurick sarahyurick marked this pull request as ready for review October 14, 2022 19:51
@sarahyurick sarahyurick changed the title [WIP] Resolve test_date_functions() Resolve test_date_functions() Oct 14, 2022
dask_planner/src/dialect.rs Outdated Show resolved Hide resolved
dask_planner/src/sql.rs Outdated Show resolved Hide resolved
dask_sql/physical/rex/core/call.py Outdated Show resolved Hide resolved
dask_sql/physical/rex/core/call.py Show resolved Hide resolved
dask_sql/physical/rex/core/call.py Outdated Show resolved Hide resolved
dask_planner/src/sql.rs Outdated Show resolved Hide resolved
dask_sql/physical/rex/core/call.py Show resolved Hide resolved
dask_sql/physical/rex/core/call.py Outdated Show resolved Hide resolved
sarahyurick and others added 3 commits October 19, 2022 11:19
Co-authored-by: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com>
Copy link
Collaborator

@charlesbluca charlesbluca left a 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

dask_planner/src/dialect.rs Outdated Show resolved Hide resolved
dask_planner/src/dialect.rs Outdated Show resolved Hide resolved
Co-authored-by: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com>
@charlesbluca charlesbluca merged commit e0b1d8e into dask-contrib:main Dec 2, 2022
Comment on lines +693 to +700
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)
Copy link
Collaborator

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?

@sarahyurick sarahyurick deleted the test_date_functions branch May 26, 2023 22:14
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.

None yet

5 participants