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

Wrong error type in case of invalid amount in Interval components #5986

Closed
DDtKey opened this issue Jul 1, 2024 · 1 comment · Fixed by #5987
Closed

Wrong error type in case of invalid amount in Interval components #5986

DDtKey opened this issue Jul 1, 2024 · 1 comment · Fixed by #5987
Labels
arrow Changes to the arrow crate bug

Comments

@DDtKey
Copy link
Contributor

DDtKey commented Jul 1, 2024

Describe the bug
Currently, if Interval value contains invalid amount component NotYetImplemented error type is returned.
That doesn't seem correct, because such values are not going to be supported (or at least, it's confusing)

Let's take a look at such example:

INTERVAL '1 MONTH DAY'

This is an obvious typo/mistake which leads to such error, but in fact it's just invalid value (missing number before DAY)

To Reproduce
There are tests for this case already:

test_unsafe_string_to_interval_err!(
vec![Some("foobar")],
IntervalUnit::YearMonth,
r#"Not yet implemented: Unsupported Interval Expression with value "foobar""#
);
test_unsafe_string_to_interval_err!(
vec![Some("foobar")],
IntervalUnit::DayTime,
r#"Not yet implemented: Unsupported Interval Expression with value "foobar""#
);
test_unsafe_string_to_interval_err!(
vec![Some("foobar")],
IntervalUnit::MonthDayNano,
r#"Not yet implemented: Unsupported Interval Expression with value "foobar""#
);

Expected behavior
Return ParseError, like other errors from parse_interval_components

Additional context

@DDtKey DDtKey added the bug label Jul 1, 2024
@DDtKey DDtKey changed the title Wrong error type in case of invalid amount of Interval components Wrong error type in case of invalid amount in Interval components Jul 1, 2024
@alamb alamb added the arrow Changes to the arrow crate label Jul 2, 2024
@alamb
Copy link
Contributor

alamb commented Jul 2, 2024

label_issue.py automatically added labels {'arrow'} from #5987

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

Successfully merging a pull request may close this issue.

2 participants