Skip to content

Upgrading marshmallow 0.2 to 0.3

Breaking0.2.1 → 0.3.1Breaking2New4Changed1Fixed2Other1

BreakingUpgrade verdict

2 breaking changes.

  • The exception class has a new name, so code catching the old name must be updated.
  • The module path changed, so imports from the old path must be updated.
2 items need code or config changes
Breaking2
Renames MarshallingException to MarshallingError.
MarshallingExceptionMarshallingError
Renames the marshmallow.core module to marshmallow.serializer.
marshmallow.coremarshmallow.serializer

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • removed: class Field(object)
  • removed: field Field.parent
  • removed: method Field.format(value)
  • removed: method Field.output(value)
  • added: class FieldABC(object)
  • added: class SerializerABC(object)
  • added: field FieldABC.parent
  • added: method FieldABC.format(value)
  • added: method FieldABC.output(key, obj)
  • added: method SerializerABC.is_valid(fields=…)
  • added: method SerializerABC.to_data()
  • added: method SerializerABC.to_json()
  • removed: class BaseSerializer(object)
  • removed: class Serializer(with_metaclass(SerializerMeta, BaseSerializer))
  • removed: class SerializerMeta(type)
  • removed: constructor BaseSerializer(data=…, extra=…, prefix=…)
  • removed: function is_instance_or_subclass(val, class_)
  • removed: function marshal(data, fields)
  • removed: function pprint(obj, *args, **kwargs)
  • removed: method BaseSerializer.is_valid(fields=…)
  • removed: method BaseSerializer.marshal(data, fields)
  • removed: method BaseSerializer.to_data(*args, **kwargs)
  • removed: method BaseSerializer.to_json(*args, **kwargs)
  • removed: property BaseSerializer.json
  • removed: class MarshallingException(MarshmallowException)
  • removed: class MarshmallowException(Exception)
  • removed: constructor MarshallingException(underlying_exception)
  • added: class MarshallingError(MarshmallowError)
  • added: class MarshmallowError(Exception)
  • added: constructor MarshallingError(underlying_exception)
  • removed: function float_to_decimal(f)
  • removed: method LocalDateTime.format(value)
  • changed: class LocalDateTime(Raw) → class LocalDateTime(DateTime)
  • changed: class Raw(Field) → class Raw(FieldABC)
  • added: constructor DateTime(default=…, attribute=…, format=…)
  • added: field DateTime.localtime
  • added: field LocalDateTime.localtime
  • added: function marshal(data, fields)
  • added: variable DATEFORMAT_FUNCTIONS
  • added: class BaseSerializer(base.SerializerABC)
  • added: class BaseSerializer.Meta(object)
  • added: class Serializer(with_metaclass(SerializerMeta, BaseSerializer))
  • added: class SerializerMeta(type)
  • added: class SerializerOpts(object)
  • added: constructor BaseSerializer(obj=…, extra=…, only=…, exclude=…, prefix=…, strict=…)
  • added: constructor SerializerOpts(meta)
  • added: field BaseSerializer.TYPE_MAPPING
  • added: method BaseSerializer.is_valid(field_names=…)
  • added: method BaseSerializer.marshal(data, fields_dict)
  • added: method BaseSerializer.to_data(*args, **kwargs)
  • added: method BaseSerializer.to_json(*args, **kwargs)
  • added: property BaseSerializer.json
  • added: static method SerializerMeta.get_declared_fields(bases, attrs, field_class)
  • removed: function rfc822(dt, localtime=…)
  • added: class UTC(datetime.tzinfo)
  • added: field UTC.zone
  • added: function isoformat(dt, localtime=…, *args, **kwargs)
  • added: function rfcformat(dt, localtime=…)
  • added: method UTC.dst(dt)
  • added: method UTC.fromutc(dt)
  • added: method UTC.localize(dt, is_dst=…)
  • added: method UTC.normalize(dt, is_dst=…)
  • added: method UTC.tzname(dt)
  • added: method UTC.utcoffset(dt)
  • added: variable HOUR
  • added: variable UTC
  • added: variable ZERO
  • added: variable utc
  • added: function float_to_decimal(f)
  • added: function is_collection(obj)
  • added: function is_indexable_but_not_string(obj)
  • added: function is_instance_or_subclass(val, class_)
  • added: function is_iterable_but_not_string(obj)
  • added: function pprint(obj, *args, **kwargs)
  • added: function to_marshallable_type(obj)