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

Dataset constructor should accept a list of documents if provided. #18

Open
devfoo-one opened this issue Oct 7, 2020 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@devfoo-one
Copy link
Member

self.documents: list = []

@devfoo-one devfoo-one added the enhancement New feature or request label Oct 7, 2020
@SchmaR
Copy link
Member

SchmaR commented Oct 7, 2020

It might be a good idea to refactor the project to use python 3.6 @dataclass Annotation. This would drastically reduce bloat and streamline the implementation. Moreover it would enable IDEs to make better suggestions and make this feature request obsolete.

Here is an example: https://github.com/DATEXIS/smartmd-backend/blob/master/domain/patient.py

@devfoo-one
Copy link
Member Author

Yes, you´re right. @dataclass is a good idea.

@SchmaR
Copy link
Member

SchmaR commented Oct 27, 2020

As discussed on rocket chat, Marshmallow and Marshmallow_Dataclass seem to be good libs for reducing boilerplate and streamlined de-/serialization.

https://lovasoa.github.io/marshmallow_dataclass/

https://marshmallow.readthedocs.io/en/stable/

@devfoo-one
Copy link
Member Author

Lets wait until we have official support for Python 3.7 on our infrastructure before we switch to dataclasses.

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

No branches or pull requests

2 participants