-
-
Notifications
You must be signed in to change notification settings - Fork 95
Prefer reading query from stdin if available #1917
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
Conversation
A recent change made it so not providing a query causes everything to be exported. However, that made it so providing a query on stdin required the option `vast.export.read` to be set to `"-"`, which was far from intuitive. This change streamlines the option, giving the user an error if conflicting ways to read the query exist and preferring stdin over exporting everything if a query is provided on stdin but not on the command line.
158a663
to
c5cec4f
Compare
2244908
to
19de763
Compare
7695435
to
a727c20
Compare
I am really stumped at why the CI makes the integration test framework think we have input on stdin, when we really don't. While we could downgrade the error to a warning and simply live with it—everything works as expected locally for both @tobim and me—, I would like to understand what's wrong here first. |
a727c20
to
f0bacf8
Compare
3221101
to
1736530
Compare
1736530
to
51cbd60
Compare
Using `!isatty()` is didn't work in case vast run in a scrip in headleass mode, i.e. during the integration tests in CI. We now use stat to check if the input is a pipe or a regular file.
6a7cd64
to
8002d83
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.
Things seem to work now (and even if it turns out the new logic is still not quite what we want, this should at least not be a regression), so I think with the CI going through we're good to go.
There are a few more nits below, but I think none of them is important enough to justify delaying the rc any further.
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.
Looks good assuming CI is happy this time; a few minor issues but as discussed I can fixup them myself.
beb7156
to
37b07dc
Compare
37b07dc
to
b7cd11d
Compare
This test provides an explicit query as input, so according to the updated logic this should not be interpreted as "export everything" anymore but as a query, and the reference data was reverted to the original state accordingly.
Finally, what a pesky issue! |
📔 Description
A recent change made it so not providing a query causes everything to be exported. However, that made it so providing a query on stdin required the option
vast.export.read
to be set to"-"
, which was far from intuitive. This change streamlines the option, giving the user an error if conflicting ways to read the query exist and preferring stdin over exporting everything if a query is provided on stdin but not on the command line.📝 Checklist
🎯 Review Instructions
It's a simple change; reading the code and passing CI should suffice.