Returns a list of lists for invoice_lines_paid_on_fund task. #1383
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1335
When triggering the digital_bookplate_instances DAG with a conf with a new fund, the funds branch will be used so that invoice_lines_paid_on_fund task will query folio for the fund_uuid in fundDistributions list of paid invoice lines. In some cases, there are more invoice lines than can be mapped to dynamic tasks (currently in prod there are 2,026 paid invoice lines with the LINDER fund). I've changed invoice_lines_paid_on_fund task to return a list of lists, e.g.
If all paid invoice lines for a particular fund is greater than 1,000, then each inner list of folio invoice line dicts will be 100. For all others it will be 5. I am a little worried that we will see a lot of dropped connections once we get to the instances_from_po_lines task for each 100 paid invoice lines, since we will be hitting okapi hard at this point and possibly seeing dropped connections for the connection pooling bug in httpx implementation of FolioClient.