-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fix: Fix response streams in template #42
Conversation
10dd8f1
to
fbf2c2f
Compare
Codecov ReportBase: 92.40% // Head: 92.59% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## fix/sampler-params #42 +/- ##
======================================================
+ Coverage 92.40% 92.59% +0.19%
======================================================
Files 221 222 +1
Lines 3040 3051 +11
Branches 354 351 -3
======================================================
+ Hits 2809 2825 +16
+ Misses 169 165 -4
+ Partials 62 61 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
f5e0e22
to
59d9e37
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.
Beside some question, others LGTM 👍
|
||
const { getData } = response; | ||
const dataStream = getData(); | ||
const data = await streamToArray(dataStream); |
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.
If we execute builder.value()
and consume the stream to the array in the ExecutorRunner
when play RuntimeExtension
and it's the final result, then how could we convert the array result to json / csv format in the middleware?
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 filter here doesn't affect the final query builder, the formators will receive an unchanged stream.
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.
Okay, thanks
new nunjucks.nodes.Symbol(node.lineno, node.colno, EXECUTE_FILTER_NAME), | ||
args | ||
); | ||
replace(filter); |
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.
Curious about replace
, when we call replace
what do we replace to ?
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 is a callback function to remove or replace the current node in order to modify the AST tree, which provided by visitChildren helper.
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 a lot for replying to me
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.
LGTM 👍 cc @oscar60310
What's happened
DataSources returned streams instead of arrays, but we haven't adjusted the template output:
This PR consume the stream and download data for templates.