-
Notifications
You must be signed in to change notification settings - Fork 80
Raise error for disallowed columns #992
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
Closed
squirrelo
wants to merge
2
commits into
qiita-spots:master
from
squirrelo:more-validation-of-columns
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👎👎👎
The reason why I strongly disagree with this line is because this columns are disallowed because that is the output of the search engine. If the columns on the search engine are in the metadata template, the search engine breaks because SQL has multiple columns with the same name and its ambiguous.
My recommended solution, which I presented offline to @squirrelo and he disagrees, is importing the list of output columns from the search engine and disallow them here. The main issue is that the list of columns exist in the search engine and here, forcing the developer to remember that if he is modifying the search engine, he has to modify also this list in case that the output columns change.
We already have had an issue on trusting the developer to do the right thing (the
purge_filepaths
function issue) and I do not agree on introducing another potential spot where this can occur. Thus, I think that minimizing code duplication and developer burden is always the right path to move forward, rather than using a comment on all caps as per suggestion of @squirrelo ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that, while your idea works for a single object, it does not scale to multiple objects. If we suddenly need disallowed columns in the analysis, job, and ontology objects in the future, what then? There will still need to be manual editing of the function to reflect those new disallowed columns, completely negating the above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antgonza 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antgonza 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note also, though, that Jose's idea violates the prime directive of qiita_db objects never importing from any other qiita_db object file. We've kept that going until now, so we should NOT break that in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this is already violated on the metadata_template.py file, so we need to change that ASAP unless we are droppng that directive and creating circular import fun again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind creating an issue about this?
On (Mar-17-15|19:52), Joshua Shorenstein wrote: