Can a Child stream be partitioned?
# singer-tap-development
c
Can a Child stream be partitioned?
I think I found an answer from @visch https://github.com/meltano/sdk/issues/271
v
It'd be great to have this baked into the SDK. It's probably a better way to think about Partitions, it's a superset of context or something along those lines instead of them being seperate
Let me know how that works for you, and upvote the issue 😄
c
I tried blindly copying the approach from your clickup tap, but can't make it work for my custom tap. Where I'm stuck now is the "automagic" interpolation of the RESTStream's
path
property. It's no longer doing that after introducing the
_sync_children()
override. I was using that functionality (i.e
path = '/api/{parent_id}/subcomponent'
with the
parent_id
coming automatically from the
self.get_child_context() -> dict
But now the child stream is just making a request to
/api/{parent_id}/subcomponent
literally.
v
My guess is context doesnt' have
partition_id
for some reason. Maybe add a breakpoint at the setter for
path
might be easier to do it at
get_records
🤷 I'd at least that's where I'd look https://gitlab.com/meltano/sdk/-/blob/main/singer_sdk/streams/rest.py#L275 is the magic 🙂
c
Ok. Fixed the
path
interpolation. That was just me not paying attention to the subtleties of the
partitions = []
vs
partitions = None
semantics 😉 Now on to figuring out why the merging of the context is seemingly not happening ...
v
may the force be with you
c
Ha! Turned out that all the weirdness I was experiencing was because the source's REST API response behaviour has quietly been updated in the meantime as I was developing against it.
v
Ahhh did it end up working for you then!?
c
Nope. Lol. Parked it for later.
v
@robby_robinson https://github.com/meltano/sdk/issues/271 up vote this 😄
Note that the github implementation works with state now