Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type object "SomeBravadoResourceType" has no attribute 'marshal' ( and 'unmarshal') #160

Closed
adamhadani opened this issue Mar 21, 2017 · 4 comments

Comments

@adamhadani
Copy link
Contributor

Started seeing these errors today after installing the just release 4.7.0 bravado-core. Downgrading to previous version (4.6.1) makes these go away so seems like some kind of regression.. Here's an example snippet:

...
chatroom_event.marshal(),
  File "/Users/adamhadani/.virtualenvs/venv/lib/python3.6/site-packages/bravado_core/model.py", line 176, in __getattr__
    .format(type(self).__name__, attr_name)
AttributeError: type object 'SomeBravadoResourceType' has no attribute 'marshal'

Also, seeing similar error when trying to use unmarshal:

...
.unmarshal({
AttributeError: type object 'SomeBravadoResourceType' has no attribute 'unmarshal'
@adamhadani
Copy link
Contributor Author

adamhadani commented Mar 21, 2017

FYI @sjaensch,
Perhaps relevant (looking at diff between v4.6.1 and master) this area - v4.6.1...master#diff-c4c247a9f02296ba0240eb0feee5e372L105 and new comment about using single underscore for private methods on resource objects, so maybe the API changed to _marshal / _unmarshal instead of marshal / unmarshal ?

If that's the case this is breaking a public API in a backward-incompatible way, at the very least worth a changelog entry and some deprecation warning grace period?? :)

@adamhadani adamhadani changed the title type object "<resource_class>" has no attribute 'marshal' ( and 'unmarshal') type object "SomeBravadoResourceType" has no attribute 'marshal' ( and 'unmarshal') Mar 21, 2017
@macisamuele
Copy link
Collaborator

@adamhadani you're right ... version 4.7.0 changes the way to marshal and unmarshal models.
Instead of using marshal and unmarshal class methods are replaced by _marshal and _unmarshal ones. This was injected by #159.

Since actually this is a back incompatible change we should change the package version and make evident in the changelog how to migrate from v4.6.1 to v5.0.0 (or any version code that will be attributed to the new version)

Thanks a lot for highlighting this ... we'll try to fix this regression soon!

@adamhadani
Copy link
Contributor Author

ping @macisamuele I have a PR on the way for this which re-introduces original function names with a deprecation warning, will ping u there when up, thanks for confirmation!

@sjaensch
Copy link
Contributor

Fixed by #161.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants