Yeah so number 1 needs to happen inside a task because
json_data
is of type Task until execution time of the flow. The
json_data[0,]
syntax accesses the Task because it runs during build time, not run time. So you need to put this logic inside a Task so that it will defer to run time instead of build time. Does that make sense?
upvote 1
Kevin Kho
03/23/2022, 11:33 PM
The second one should work though right?
k
Ken Nguyen
03/23/2022, 11:34 PM
Ah I see! I shall test it out, thanks for the quick support
Ken Nguyen
03/23/2022, 11:42 PM
Yep it now works, thank you for your help and explanation
Ken Nguyen
03/23/2022, 11:51 PM
I do have a follow up question actually, I tried to display json_data in the logs by doing
<http://logger.info|logger.info>(json_data)
However, I don’t actually see anything get printed in the logs. Could you tell me why that’s happening?
Ken Nguyen
03/23/2022, 11:54 PM
Do I need to make a task that does logging and use that task to print the output instead?
k
Kevin Kho
03/23/2022, 11:58 PM
Yeah exactly. Logs in the flow block are executed during build time, not run time
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.