-
Notifications
You must be signed in to change notification settings - Fork 219
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
Tee verb outputs the end of the chain (or at least some of it) #1671
Comments
Hi @holmescharles what's your miller version? Using the last one, if I run
I have
|
About tee, it emulates GNU tee. I have in example this input CSV
and I run this to exclude all rows where the
I will have both in
And then I could add a standard grep
to have
The output file remains unchanged. |
I had 6.12, though I see 6.13 was released a day after I made this post. I just tried both versions and I get the same output as I reported in my original post. Regarding your post, are you saying that tee is meant to be called at the end of a chain and never in the middle of a chain? |
Wherever you want. If you have
and run
you get in
and you get the [
{
"txt": "Andy",
"value": 45,
"s": 1
},
{
"txt": "Tom",
"value": 87,
"s": 1
},
{
"txt": "Anna",
"value": 8,
"s": 1
},
{
"txt": "Ralph",
"value": 15,
"s": 1
}
] |
When I run
Standard out:
out.json:
It is still not clear to me if the addition of the "n" fields is expected or not. |
It seems to me a bug. You should not have the If you change output format (i.e. |
It seems to work properly with rectangular output format (CSV, TSV) |
No I don't. The header lacks the erroneous column, but the last two columns each have the extra value.
out.csv:
|
You are right |
Now that I see a CSV with a wrong structure I'm sure it's a bug |
Please @johnkerl ,as soon as you can, will you let us know if it looks like a bug? Thank you |
I am having a little bit of trouble nailing down the exact issue here, but the upshot is that tee is misbehaving. I will try my best to provide examples that illustrate the issues
The
tee
verb does not have a description of what it is supposed to do, but my intuition is that it should emulate GNU tee and write a file with the state of the data at the point where its called. But it seems like its adding data from later in the chain.For this call...
...the output is...
It looks like an
n
from the cat verb has been to the tee-ed output.Other calls can add even more of the later data, e.g.:
Not only does each record have the
n
added from cat, but there's a gap for some reason, too.I don't know enough about mlr's implementation to hypothesize what the error is. Any help would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: