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

Fix get_last_documents to return valid Document objects #201

Merged
merged 3 commits into from
Dec 22, 2018
Merged

Conversation

lukehsiao
Copy link
Contributor

The previous implementation would track the last parsed documents using
a set of Document objects returned by a Preprocesser. Thus, when a user
called get_last_documents, they would get Documents, but not Documents
which had any linkage to the underlying database, and thus could not
view the document's ID, or relationships like Sentences.

This commit is twofold. First, we move the get_last_documents call
implementation to the Parser, rather than having it in the UDF. This
just makes more organizational sense. Second, it queries the database
for Documents by filtering on the names of the last documents, ensuring
that the returned documents can be navigated by the user (e.g., to view
the Sentences).

@lukehsiao lukehsiao added the bug Something isn't working label Dec 22, 2018
@lukehsiao lukehsiao added this to the v0.5.0 milestone Dec 22, 2018
@lukehsiao lukehsiao self-assigned this Dec 22, 2018
@lukehsiao lukehsiao requested a review from senwu December 22, 2018 08:05
Copy link
Collaborator

@senwu senwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@lukehsiao lukehsiao changed the title Fix get_last_documents Fix get_last_documents to return valid Document objects Dec 22, 2018
…the db

The previous implementation would track the last parsed documents using
a set of Document objects returned by a Preprocesser. Thus, when a user
called `get_last_documents`, they would get Documents, but not Documents
which had any linkage to the underlying database, and thus could not
view the document's ID, or relationships like Sentences.

This commit is twofold. First, we move the `get_last_documents` call
implementation to the Parser, rather than having it in the UDF. This
just makes more organizational sense. Second, it queries the database
for Documents by filtering on the names of the last documents, ensuring
that the returned documents can be navigated by the user (e.g., to view
the Sentences).
@lukehsiao lukehsiao merged commit 207daf8 into master Dec 22, 2018
@lukehsiao lukehsiao deleted the lh-patch branch December 22, 2018 15:59
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

Successfully merging this pull request may close these issues.

2 participants