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.

RFC: Change the way we store metadata?

See original GitHub issue

Users are often bit by the fact that fields store arbitrary keyword arguments as metadata. See https://github.com/marshmallow-code/marshmallow/issues/683.

…The reasons we use **kwargs instead of e.g. metadata= are mostly historical. The original decision was that storing kwargs 1) was more concise and 2) saved us from having to come up with an appropriate name… “metadata” didn’t seem right because there are use cases where the things your storing aren’t really metadata. At this point, it’s not worth breaking the API.

Not the best reasons, but I think it’s not terrible. We’ve discussed adding a whitelist of metadata keys in the past, but we decided it wasn’t worth the added API surface.

_Originally posted by @sloria in https://github.com/marshmallow-code/marshmallow/issues/779#issuecomment-522283135_

Possible solutions:

  1. Use metadata=.
  2. Specify a whitelist of allowed metadata arguments.

Feedback welcome!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
sloriacommented, Jan 11, 2021

That issue is rather specific to the marshmallow-dataclass, and I think the benefits still outweigh the cost. It is much better to have a proper exception get raised when a user passes an invalid keyword argument rather than passing silently.

2reactions
lafrechcommented, Oct 11, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 5464: The IMAP METADATA Extension
RFC 5464 The IMAP METADATA Extension February 2009 is stored on a per-user basis ... they are set by the server and cannot...
Read more >
RFC Metadata in CPI (former HCI) - SAP Community
Hi experts, I have a scenario in wich I consume a RFC from Cloud Platform Integration flow via SCC. But I needded to...
Read more >
Requirements for Internet Media Guides (IMGs) RFC 4473
Informational [Page 1] RFC 4473 Requirements for Internet Media Guides (IMGs) May 2006 ... Thus, we envision that IMG metadata can be sent...
Read more >
RFC-27 Data skipping index to improve query performance
So we propose a new solution to store additional information as part of Hudi metadata table to implement data skipping index. The goals...
Read more >
Metadata - Wikipedia
Metadata is "data that provides information about other data", but not the content of the data, such as the text of a message...
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