emcp
05/25/2023, 8:07 PMemcp
05/26/2023, 3:34 PMemcp
05/26/2023, 3:37 PMemcp
05/26/2023, 3:37 PMemcp
05/26/2023, 3:45 PMclass NewsBodyStream(Stream):
query_size_parent = 0
query_array_parent = []
ibkr_thrift_client = None
def get_records(self, context: dict | None) -> t.Iterable[dict | tuple[dict, dict | None]]:
<http://self.logger.info|self.logger.info>("CONFIG = " + str(self.config) + "parentStream " + str(self.parent_stream_type) + "schema " + str(self.schema) + "stream context = " + str(context))
if self.query_size_parent == 0:
self.query_size_parent = context['query_size']
self.query_array_parent.append(context)
# If this is true, we've gathered the entire upstream query and can proceed to execute
if len(self.query_array_parent) == self.query_size_parent:
# EXECUTE THE QUERY AS A BATCH AND YIELD RESULTS ONCE THEY COME BACK IN A LOOP
else:
yield {}emcp
05/26/2023, 8:25 PMemcp
05/26/2023, 10:08 PMemcp
05/26/2023, 10:08 PMemcp
05/28/2023, 5:05 PMemcp
05/28/2023, 5:20 PMIf the number of parent items is very large (thousands or tens of thousands), you can optionally set state_partitioning_keys on the child stream to specify a subset of context keys to use in state bookmarks. (When not set, the number of bookmarks will be equal to the number of parent items.) If you do not wish to store any state bookmarks for the child stream, set state_partitioning_keys to [].
https://sdk.meltano.com/en/latest/parent_streams.htmlemcp
05/28/2023, 5:20 PMemcp
05/28/2023, 6:06 PMA method which should retrieve data from the source and return records
incrementally using the python `yield` operator.
turns out I just thought you should yield in all cases.. I will now switch to return the data and see if that changes the behavior (fingers crossed)