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

Support for dynamic creation of Items #56

Closed
walison17 opened this issue May 3, 2020 · 4 comments
Closed

Support for dynamic creation of Items #56

walison17 opened this issue May 3, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@walison17
Copy link
Contributor

walison17 commented May 3, 2020

currently is not possible to create items that inherit from AbstractComplexExtractor, the code breaks when _check_field_overwrites_method() is executed

@walison17 walison17 changed the title support for dynamic generated Support for dynamic creation of Items May 3, 2020
@linw1995
Copy link
Owner

linw1995 commented May 3, 2020

Is there any code cases that reproduce your problem? Please describe your code, express what you expect and what error it actually produces.

@walison17
Copy link
Contributor Author

walison17 commented May 3, 2020

from data_extractor import Item, Field, JSONExtractor


type("Foo", (Item,), {"bar": Field(JSONExtractor("bar"))})

This code above raises:

AssertionError: Can't find the source of <class '__main__.Foo'>.

Ps.: I am using python 3.8.2

linw1995 added a commit that referenced this issue May 3, 2020
- d28fff4 Fix:Item created error by ``type`` function. (Issue #56)
@linw1995 linw1995 added the bug Something isn't working label May 3, 2020
@linw1995
Copy link
Owner

linw1995 commented May 3, 2020

This bug is fixed. Thanks for your help. @walison17

@linw1995 linw1995 closed this as completed May 3, 2020
@walison17
Copy link
Contributor Author

Thanks @linw1995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants