_load should remove type_field from data before shema load
See original GitHub issueLeaving the type field in the data dictionary generates errors when calling shema.load.
errors={'_schema': ['Unknown field name type.']})
It could be pop instead of get, but this would modify the data, so we have to copy the dict before.
Possible implementation:
def _load(self, data, partial=None):
data_copy = dict(data)
data_type = data_copy.pop(self.type_field)
[...]
return schema.load(data_copy, many=False, partial=partial)
What do you think?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
API Reference — marshmallow 3.19.0 documentation
Deserialize a data structure to an object defined by this Schema's fields. loads (json_data, *[ ... Same as load() , except it takes...
Read more >ruby on rails - How to use db:schema:load without erasing data
(2) Work around: Before doing a db:schema:load, get a db_dump of your database. If you check rake db:migrate:status at this time, ...
Read more >Loading CSV data from Cloud Storage | BigQuery
When you load CSV files into BigQuery, note the following: CSV files do not support nested or repeated data. Remove byte order mark...
Read more >Ecto.Schema — Ecto v3.9.4 - HexDocs
An Ecto schema maps external data into Elixir structs. ... metadata holding the status of the struct, for example, if it has been...
Read more >DataFrameReader (Spark 3.1.3 JavaDoc) - Apache Spark
Loads input in as a DataFrame , for data sources that don't require a path ( ... If the option is set to...
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 Ok, I got this. Thanks for reporting and helping with repro!
Although I prefer forgiving schemas (ones that ignore extra fields) I agree that it makes sense to remove added type attribute. I will look into this.