-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Describe the bug
The following does not work when running substation read.
{
...
transforms: [
sub.tf.aggregate.to.array(settings={ object: { batch_key: 'key' } }),
sub.tf.object.jq(settings={filter: '.'}),
]
}
To Reproduce
Create a in.json with the following input data.
{ "a": "hello", "key": "x"}
{ "b": "world", "key": "x"}
{ "c": "surprise", "key": "y"}Create a config.jsonnet like this:
local sub = std.extVar('sub');
{
tests: [
{
name: 'aggregate_jq',
transforms: [
sub.tf.test.message({ value: { a: 'hello', key: 'x'} }),
sub.tf.test.message({ value: { b: 'world', key: 'x'} }),
sub.tf.test.message({ value: { c: 'surprise', key: 'y'} }),
sub.tf.send.stdout(),
],
condition: sub.cnd.all([
sub.condition.format.json()
]),
},
],
transforms: [
sub.tf.aggregate.to.array({ object: { batch_key: 'key' } }),
sub.tf.object.jq(settings={filter: '.'}),
sub.tf.send.stdout(),
],
}Then run the following.
substation read config.jsonnet --file in.jsonYou should see an output similar to this:
Error: transform 123dce80-8942201a: context canceled
Expected behavior
The transform should run successfully.
Build:
- Architecture: MacOS, using
substation read .. --file .. - Version 2.6.0
Additional context
My debugging journey so far:
- The
object_jqTransform will get called with actxthat is already canceled. - Changing this line to take in a new context will fix the issue. (I'm not sure if this is what we want, though.)
- I tried following the execution flow in
cmd/substation/read.go, but I had trouble making sense of the output. I can paste the trace I built here if needed. I would seeaggregateget called for each message. Then, at the end there was a failed called toobject_jq. - It seems like
substation testpasses?
If this should have been a discussion instead, I can move it over!
Thank you for a great library!
Metadata
Metadata
Assignees
Labels
No labels