pre_load many has issues in 3.5.0
See original GitHub issueIn marshmallow 3.4.0 data is a list, which is what I expect, when using pass_many.
In marshmallow 3.5.0 data is a single object.
@pre_load(pass_many=True)
def reposition_tasks(self, data, **kwargs):
position = 0
for task in data:
task["position"] = position
position += 1
return data
Do you have a suggestion, what I am doing wrong? Or is this a bug?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Strange preloading bug in Ecto 3.5.0-rc.0 · Issue #3415 - GitHub
While testing Ecto 3.5.0-rc.0 I've noticed a strange preloading bug. In some cases, a list of multiple preloads sets the association fields ......
Read more >Very slow admin side, others OK.Preload components takes ...
Problem Description :: wrote: Admin side very slow, debug shows that Before Access::preloadComponents (all components) takes 33 seconds, ...
Read more >ophcrack / News - SourceForge
Ophcrack preloading has been rewritten to fix issues found in the version 3.5.0. Support of the probabilistic tables was improved as well.
Read more >To Configure Multiple Preloading Methods - PingDirectory - 8.0
The database values themselves can be cached in the background once the server has been started with the cursor-across-indexes option. $ bin/ ...
Read more >action_scheduler_run_queue event - WordPress.org
I tried 3.5.0 on a test site. I deleted event with wp cron event delete action_scheduler_run_queue . Tested products after deleting event. No...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lafrech Okay well I have to second this issue then and I just double checked my work.
List(Nested(Schema))
does not work withpre_load
on the child schema because it passes single objects instead of the many objects as it would before.However, if I think about it a bit more I realize this means that I should change my
do_something
logic to handle each individual item instead of the whole list at once which makes more sense IMO. Before I was using the bug instead of fixing it and I see it now.But perhaps the ‘issue’ I was facing could be a legitimate issue for another use case?
Thanks @lafrech and @sloria
I think the question is answered. New behaviour is the correct one.