question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pre_load many has issues in 3.5.0

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
michaeltoohigcommented, Apr 2, 2020

@lafrech Okay well I have to second this issue then and I just double checked my work. List(Nested(Schema)) does not work with pre_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

0reactions
lafrechcommented, Apr 8, 2021

I think the question is answered. New behaviour is the correct one.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found