-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow testing records with sibling whitespace in SLT tests and add more string tests #13197
Allow testing records with sibling whitespace in SLT tests and add more string tests #13197
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
7d41bee
to
e64d6d0
Compare
d4ea9ef
to
1a3ac85
Compare
1a3ac85
to
fa96eb3
Compare
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 @findepi why tests have different results, excluding formatting
.collect::<Vec<_>>(); | ||
let actual = actual | ||
.iter() | ||
.map(|strs| strs.iter().join(" ")) |
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.
we prob can do this in a sinlge map?
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.
I am not quite sure what you are suggesting here
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.
I'm suggesting to have a single collection iteration instead of two
.map(|strs| strs.iter().join(" ").trim_end().to_owned())
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.
yes, we can do this in single map.
i placed this into two map() steps so that the common part of actual and expected processing looks the same and so that i can write a nice comment
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.
.collect::<Vec<_>>(); | ||
let actual = actual | ||
.iter() | ||
.map(|strs| strs.iter().join(" ")) |
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.
I am not quite sure what you are suggesting here
let expected = expected | ||
.iter() | ||
// Trailing whitespace from lines in SLT will typically be removed, but do not fail if it is not | ||
// If particular test wants to cover trailing whitespace on a value, |
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.
This is probably a good thing to add in the user documentation (aka https://github.com/apache/datafusion/blob/main/datafusion/sqllogictest/README.md)
I think it would be hard to find here for someone writing sqllogictests
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.
it feels so edge-case'y. but yes, we can add
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.
I will make a follow on PR
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.
- Follow on PR for documentation: Minor: Document how to test for trailing whitespace in
slt
/ sqllogictests #13215
@comphead please see https://github.com/apache/datafusion/pull/13197/commits |
EXPR LIKE 'constant'
toexpr = 'constant'
#13061 (comment)