Hi @alafanechere , thanks for the quick reply!
Yes I got most of your answer. So in theory, if i change it to following, it should work?
class PipedriveSubstream(PipedriveStream, HttpSubStream, ABC):
def __init__(self, parent: PipedriveStream, authenticator, replication_start_date=None, **kwargs):
super().__init__(parent=parent, authenticator=authenticator, replication_start_date=replication_start_date, **kwargs)
def stream_slices(
self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
) -> Iterable[Optional[Mapping[str, Any]]]:
parent_stream_slices = self.parent.stream_slices(
sync_mode=sync_mode, cursor_field=cursor_field, stream_state=stream_state
)
# iterate over parent stream_slices
for stream_slice in parent_stream_slices:
parent_records = self.parent.read_records(
sync_mode=sync_mode, cursor_field=cursor_field, stream_slice=stream_slice, stream_state=stream_state
)
# iterate over all parent records with current stream_slice
for record in parent_records:
yield {"parent": record}
class DealFlow(PipedriveSubstream, ABC):
"""
API docs: https://developers.pipedrive.com/docs/api/v1/Deals#getDealUpdates
"""
def __init__(self, deals_stream: Deals, authenticator, replication_start_date=None, **kwargs):
super().__init__(parent=deals_stream, authenticator=authenticator, replication_start_date=replication_start_date, **kwargs)
def path(
self, stream_state: Mapping[str, Any] = None, stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
) -> str:
return f"deals/{stream_slice['parent']['id']}/flow"
If it is this easy, I’m wondering why is the default behavior of the stream_slices
to set sync_mode = Full
instead of passing it through?