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

Parser.clear() does not clear until session.commit() is executed #457

Closed
HiromuHota opened this issue Jun 16, 2020 · 1 comment
Closed

Comments

@HiromuHota
Copy link
Contributor

Description of the bug

Parser.clear() does not clear anything until session.commit() is executed elsewhere.
According to https://docs.sqlalchemy.org/en/13/orm/session_basics.html#deleting,

The Session.delete() method places an instance into the Session’s list of objects to be marked as deleted

To Reproduce

Steps to reproduce the behavior:

>>> corpus_parser.apply(doc_preprocessor)
>>> corpus_parser.clear()
>>> assert session.query(Document).count() == 0

Expected behavior

When corpus_parser.clear() above is executed, any instance of Context like Document, Sentence should be deleted.

Error Logs/Screenshots

If applicable, add error logs or screenshots to help explain your problem.

Environment (please complete the following information)

  • Fonduer Version: 0.8.2

Additional context

Add any other context about the problem here.

This might be related to #213

@HiromuHota
Copy link
Contributor Author

I'm trying to write a unit test that can reproduce this issue, but can't.
Close for now.

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

1 participant