-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RootPathMiddleware: group items in packages #944
Conversation
@jpmckinney I will update the tests if you are ok with the approach |
Co-authored-by: James McKinney <26463+jpmckinney@users.noreply.github.com>
…bject. chore: Move some calculations outside of for-loops. test: Test RootPathMiddleware with FileItem as input. docs: Clarify what spider middlewares modify. Add comments to test cases.
I added a commit. I'm not sure what the appropriate logic should be for the last test case I added: https://github.com/open-contracting/kingfisher-collect/pull/944/files#diff-1d540996fd6e3d41c94656e00cd66d49ee9e5951ca8fc23a00a500475958a498R428-R431 The PR before my commit would not yield anything if the |
Hmm, for data use, I guess it is better to drop/not yield empty objects. However, for checking the data and informing the publisher, I think leaving the data as it comes is preferred. |
Yes - and hopefully it's rarely or never the case that it is empty, so shouldn't be too much a problem for users. |
FYI, I added a commit to not yield anything if a root_path points to an empty array, to simplify the logic 862dd0b |
closes #942