#3822 Ming should not raise an exception when reading an extra field

v1.0.0
closed
sf-1 (616)
General
nobody
2015-08-20
2012-02-29
No

See [#3684] where we thought an upgrade to ming would fix it. It didn't. There's even a ming test for this feature, but apparently it isn't testing the same thing. Here's an sfpy trace:

  File "/home/dbrondsema/dbrondsema-7021/sfpy/sf.gutenberg/sf/gutenberg/model/project.py", line 441, in getSF
    return cls.m.get(shortname=shortname)
  File "/var/local/env-sfpy/lib/python2.7/site-packages/ming/metadata.py", line 140, in inner
    return method(*all_args, **kwargs)
  File "/var/local/env-sfpy/lib/python2.7/site-packages/ming/session.py", line 55, in get
    return cls.make(bson)
  File "/var/local/env-sfpy/lib/python2.7/site-packages/ming/metadata.py", line 353, in make
    return cls.m.make(data, allow_extra=allow_extra, strip_extra=strip_extra)
  File "/var/local/env-sfpy/lib/python2.7/site-packages/ming/metadata.py", line 284, in make
    data, allow_extra=allow_extra, strip_extra=strip_extra)
  File "/var/local/env-sfpy/lib/python2.7/site-packages/ming/schema.py", line 329, in validate
    return super(Document, self).validate(value, **kw)
  File "/var/local/env-sfpy/lib/python2.7/site-packages/ming/schema.py", line 229, in validate
    return self._validate(value, **kw)
  File "/var/local/env-sfpy/lib/python2.7/site-packages/ming/schema.py", line 349, in _validate
    result.update(super(Document, self)._validate(d, allow_extra, strip_extra))
  File "/var/local/env-sfpy/lib/python2.7/site-packages/ming/schema.py", line 307, in _validate
    raise Invalid('Extra keys: %r' % extra_keys, d, None)

Related

Tickets: #3861

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-03-12
    • status: open --> in-progress
    • assigned_to: Dave Brondsema
    • size: --> 1
    • milestone: dir-mar-23 --> forge-mar-23
     
  • Dave Brondsema

    Dave Brondsema - 2012-03-12

    Very latest ming should fix this, thanks to commit from Rick

     
  • Dave Brondsema

    Dave Brondsema - 2012-03-12

    Test pass; need to make a ming release and update requirements.txt to 0.3+

     
  • Dave Brondsema

    Dave Brondsema - 2012-03-22
    • status: in-progress --> blocked
     
  • Dave Brondsema

    Dave Brondsema - 2012-03-22

    Blocked by [#3896]

     
  • Dave Brondsema

    Dave Brondsema - 2012-03-23
    • status: blocked --> closed
     
  • Dave Brondsema

    Dave Brondsema - 2012-03-23

    Confirmed this works with Ming 0.2.2dev-20120305 and sfpy's ming configuration

     

Log in to post a comment.