{"action":"created","issue":{"url":"https://api.github.com/repos/klen/mixer/issues/108","repository_url":"https://api.github.com/repos/klen/mixer","labels_url":"https://api.github.com/repos/klen/mixer/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/klen/mixer/issues/108/comments","events_url":"https://api.github.com/repos/klen/mixer/issues/108/events","html_url":"https://github.com/klen/mixer/issues/108","id":371443801,"node_id":"MDU6SXNzdWUzNzE0NDM4MDE=","number":108,"title":"Error when using a Marshmallow schema","user":{"login":"snoepkast","id":1407794,"node_id":"MDQ6VXNlcjE0MDc3OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1407794?v=4","gravatar_id":"","url":"https://api.github.com/users/snoepkast","html_url":"https://github.com/snoepkast","followers_url":"https://api.github.com/users/snoepkast/followers","following_url":"https://api.github.com/users/snoepkast/following{/other_user}","gists_url":"https://api.github.com/users/snoepkast/gists{/gist_id}","starred_url":"https://api.github.com/users/snoepkast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoepkast/subscriptions","organizations_url":"https://api.github.com/users/snoepkast/orgs","repos_url":"https://api.github.com/users/snoepkast/repos","events_url":"https://api.github.com/users/snoepkast/events{/privacy}","received_events_url":"https://api.github.com/users/snoepkast/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-18T09:38:50Z","updated_at":"2018-10-18T12:39:28Z","closed_at":null,"author_association":"NONE","body":"I get the following error when I want to generate an object using a marshmallow schema:\r\n\r\n```\r\nValueError: Mixer (<class 'src.users.schemas.UserSchema'>): Generation for OPTIONS_CLASS (UserSchema) has been stopped. Exception: __init__() missing 1 required positional argument: 'meta'\r\n```\r\n\r\nThe code is:\r\n\r\n```\r\nfrom marshmallow import Schema, fields\r\nfrom mixer.main import mixer\r\n\r\nclass UserSchema(Schema):\r\n    id = fields.Integer(read_only=True)\r\n    email = fields.String()\r\n    first_name = fields.String()\r\n    last_name = fields.String()\r\n\r\nuser = mixer.blend(UserSchema)\r\n```\r\n\r\nI saw [this issue](https://github.com/klen/mixer/issues/54) open, which indicates this is not possible yet. But it is in the docs already [here](https://github.com/klen/mixer#marshmallow-workflow).\r\n\r\nVersions:\r\n```\r\npython==3.7.0\r\nmarshmallow==2.16.0\r\nmixer==6.1.3\r\n```\r\n\r\nAny help would be appreciated!"},"comment":{"url":"https://api.github.com/repos/klen/mixer/issues/comments/430992631","html_url":"https://github.com/klen/mixer/issues/108#issuecomment-430992631","issue_url":"https://api.github.com/repos/klen/mixer/issues/108","id":430992631,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDk5MjYzMQ==","user":{"login":"snoepkast","id":1407794,"node_id":"MDQ6VXNlcjE0MDc3OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1407794?v=4","gravatar_id":"","url":"https://api.github.com/users/snoepkast","html_url":"https://github.com/snoepkast","followers_url":"https://api.github.com/users/snoepkast/followers","following_url":"https://api.github.com/users/snoepkast/following{/other_user}","gists_url":"https://api.github.com/users/snoepkast/gists{/gist_id}","starred_url":"https://api.github.com/users/snoepkast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoepkast/subscriptions","organizations_url":"https://api.github.com/users/snoepkast/orgs","repos_url":"https://api.github.com/users/snoepkast/repos","events_url":"https://api.github.com/users/snoepkast/events{/privacy}","received_events_url":"https://api.github.com/users/snoepkast/received_events","type":"User","site_admin":false},"created_at":"2018-10-18T12:39:28Z","updated_at":"2018-10-18T12:39:28Z","author_association":"NONE","body":"On python 2.7.13 I get a different error:\r\n\r\n```\r\n__init__() takes exactly 2 arguments (1 given)\r\nTraceback (most recent call last):\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 241, in gen_value\r\n    value = fab()\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 134, in blend\r\n    target = self.populate_target(values)\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 157, in populate_target\r\n    target = self.__scheme()\r\nTypeError: __init__() takes exactly 2 arguments (1 given)\r\nTraceback (most recent call last):\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 568, in blend\r\n    return type_mixer.blend(**values)\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 116, in blend\r\n    for name, value in defaults.items()\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 116, in <genexpr>\r\n    for name, value in defaults.items()\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/mix_types.py\", line 222, in gen_value\r\n    return type_mixer.gen_field(field)\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 193, in gen_field\r\n    return self.gen_value(field.name, field, unique=unique)\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 247, in gen_value\r\n    field_name, self.__scheme.__name__, exc))\r\nValueError: Mixer (<class '__main__.UserSchema'>): Generation for OPTIONS_CLASS (UserSchema) has been stopped. Exception: __init__() takes exactly 2 arguments (1 given)\r\n\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 568, in blend\r\n    return type_mixer.blend(**values)\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 116, in blend\r\n    for name, value in defaults.items()\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 116, in <genexpr>\r\n    for name, value in defaults.items()\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/mix_types.py\", line 222, in gen_value\r\n    return type_mixer.gen_field(field)\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 193, in gen_field\r\n    return self.gen_value(field.name, field, unique=unique)\r\n  File \"/Users/allard/.virtualenvs/marshmallow-mixer-test/lib/python2.7/site-packages/mixer/main.py\", line 247, in gen_value\r\n    field_name, self.__scheme.__name__, exc))\r\nValueError: Mixer (<class '__main__.UserSchema'>): Generation for OPTIONS_CLASS (UserSchema) has been stopped. Exception: __init__() takes exactly 2 arguments (1 given)\r\n```"}}
{"actor":{"display_login":"snoepkast"}}