Hello ! Is it possible to trigger a child stream b...
# singer-tap-development
a
Hello ! Is it possible to trigger a child stream based on a condition in the parent stream ? For example : if the parent response contains a
contact_id
key, I would like to trigger the child stream to get the contact information Thank you
s
I just did this with
tap-slack
. https://github.com/MeltanoLabs/tap-slack/blob/adabada70884ca5b069a10f077a57cb5ebfae017/tap_slack/streams.py#L103 Basically, in the
post_process
function, I checked for the value and if it's there, I run
child_stream.sync()
.
a
Thank you @stephen_bailey
s
one thing to note there is that i did not use the parent-child functionality, so that i could avoid some of the built-in logic. the two areas that impacts are state handling and direct syncing: 1. you may want to disable the
state_partitioning_keys
in the child stream, if there could potentially be a lot of these child stream partitions. otherwise, you might get a new entry for each
parent_id
. 2. i couldn't figure out how to make the
threads
stream not run its own individual sync by itself. however, it ends up not being much of a problem since it just returns nothing and moves on.
a
haha I was struggling with your 2nd point and wanted to ask you ! 😅 Because my
url
is generated based on
context
information, it’s not working for me 😢
s
does the stream work when triggered by the parent but fails when running by itself?
a
that’s it
s
i wonder if there is a way to: allow a stream to be "selected", but prevent the stream from running during a full sync? use case here is that we want a stream to be invokable by another stream type, but not in a direct parent-child way