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

Date vs string #71

Merged
merged 7 commits into from
Apr 8, 2024
Merged

Date vs string #71

merged 7 commits into from
Apr 8, 2024

Conversation

romainfrancois
Copy link
Collaborator

No description provided.


expect_snapshot(error = TRUE,
spaceship_rfuns(as.Date("2024-03-21"), "not a date", "==")
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding those so that we can track the errors we get in both cases. I don't think the rfuns error should match the R error, but we could adjust if needed, i.e. catch the ConversionException thrown by Date::FromString() and make it look more like the R error.

duckdbrfuns:::spaceship_rfuns(as.Date("2024-03-21"), "not a date", "==")
#> Error in `map()` at duckdb-rfuns-r/R/relop.R:75:3:
#> ℹ In index: 1.
#> ℹ With name: x.
#> Caused by error:
#> ! Error evaluating duckdb query: Conversion Error: date field value out of range: "not a date", expected format is (YYYY-MM-DD)
duckdbrfuns:::spaceship_r(as.Date("2024-03-21"), "not a date", "==")
#> Error in `map()`:
#> ℹ In index: 1.
#> ℹ With name: ==.
#> Caused by error in `charToDate()`:
#> ! character string is not in a standard unambiguous format

Created on 2024-04-01 with reprex v2.1.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same for timestamps:

duckdbrfuns:::spaceship_rfuns(as.POSIXct(strptime("2024-02-21 14:00:00", format = '%Y-%m-%d %H:%M:%S')), "not a time", "==")
#> Error in `map()` at duckdb-rfuns-r/R/relop.R:75:3:
#> ℹ In index: 1.
#> ℹ With name: x.
#> Caused by error:
#> ! Error evaluating duckdb query: Conversion Error: timestamp field value out of range: "not a time", expected format is (YYYY-MM-DD HH:MM:SS[.US][±HH:MM| ZONE])
duckdbrfuns:::spaceship_r(as.POSIXct(strptime("2024-02-21 14:00:00", format = '%Y-%m-%d %H:%M:%S')), "not a time", "==")
#> Error in `map()`:
#> ℹ In index: 1.
#> ℹ With name: ==.
#> Caused by error in `as.POSIXlt.character()`:
#> ! character string is not in a standard unambiguous format

Created on 2024-04-01 with reprex v2.1.0

@romainfrancois romainfrancois requested a review from krlmlr April 1, 2024 13:15
@romainfrancois
Copy link
Collaborator Author

I think the build errors are unrelated.

@krlmlr
Copy link
Collaborator

krlmlr commented Apr 1, 2024

Upstream: hendrikmuhs/ccache-action#184

Copy link
Collaborator

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

Thanks!

@romainfrancois romainfrancois merged commit 9195fa8 into main Apr 8, 2024
33 of 39 checks passed
@romainfrancois romainfrancois deleted the date_vs_string branch April 8, 2024 07:28
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.

2 participants