Skip to content
#

deserialization

Here are 312 public repositories matching this topic...

zachelrath
zachelrath commented Jul 9, 2019

Currently, when SortMapKeys is set to true in Config, map keys are sorted using a standard alphanumeric sort. It should be possible to specify a custom map key sorting function to use, in order to prioritize certain map keys over others.

Example: Standard SortMapKeys behavior:

cfg := jsoniter.Config{
   SortMapKeys: true,
}.Froze()

m := map[string]int{
   "beta": 2,
   "alp
psverkada
psverkada commented Jan 14, 2020

The fact that exclude takes dotted notation for nested fields, but unknown does not apply to nested fields, means that exclude doesn't work for nested fields in some common use cases unless the nested schema(s) have the desired Meta.unknown setting, and then they are not runtime-flexible, which is the great benefit of Schema and load taking exclude. Somewhat new to marshmallow so mayb

tetraptych
tetraptych commented Nov 11, 2017

DateType and DateTimeType and subclasses use datetime.datetime.strptime, which in turn uses the dateutil library. Unfortunately, this library is much slower at ISO8601 date parsing than C-based alternatives (in particular, ciso8601):

import datetime
import ciso8601
%timeit datetime.datetime.strptime('2018-01-01', '%Y-%m-%d')
# 10.5 µs ± 440 ns per loop (mean ± std. dev. of 7 r
steeni
steeni commented Apr 2, 2020

I think the instructions and code examples could be more specific about the fact that readValue is reified and it needs to be imported in order for the mapper to work.

import com.fasterxml.jackson.module.kotlin.readValue

I spent some time finding an issue with my code because I did not take wildcard import instruction literally. I just imported jacksonObjectMapper from the kotlin module. :

max-ym
max-ym commented Apr 9, 2019

Function borrowed_name (in quick_xml::events::BytesStart) as is stated in documentation - can be used to create BytesStart from a given name. But if you pass (by mistake or intentionally) attribute data in the string alongside with the name this function does not parse those attributes nor verify if actually passed data is a valid name. It will treat any kind of data as a name even if it is not

mgrandi
mgrandi commented Dec 13, 2019
  • cattrs version: 0.9.0
  • Python version: 3.8
  • Operating System: windows

Description

It appears that when you have attr classes that are in a file with from __future__ import annotations, cattrs does not work when trying to structure a simple type to your attrs class. This is because attrs uses __annotations__ to get the type annotations and with PEP-563, these are now strings i

Improve this page

Add a description, image, and links to the deserialization topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the deserialization topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.