-
Notifications
You must be signed in to change notification settings - Fork 80
Analysis cart creation #1025
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
Analysis cart creation #1025
Conversation
…nalysis-changes
Ready for review/merge |
Note that #1006 also has a 20.sql. My guess is that this should be 21.sql, right? |
If that pull request is merged first, yes. I'll update once it's merged. |
Neither pull request depends on the other, so feel free to review and merge this one first as well. |
…nalysis-changes
@@ -79,6 +79,26 @@ def _status_setter_checks(self, conn_handler): | |||
raise QiitaDBStatusError("Can't set status away from public!") | |||
|
|||
@classmethod | |||
def get_user_default(cls, user): |
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.
Uhm... from my point of view, is usually better to ask the user: give me your default cart. It will be a instance method rather than a classmethod, which is already a signal of better design...
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.
This allows you to return the actual object already instantiated, as opposed to just the ID and instantiating, saving a DB call. Do we care about the extra DB call?
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.
You are not saving any DB call...
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 check if ID exists on Analysis instantiation isn't needed in this case. That's the DB call I'm referring to.
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.
That call is executed when you are doing cls(aid)
(It is calling the init)
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.
Oh, didn't realize that. Sure, can make that change then.
ready for review/merge |
static_info = conn_handler.execute_fetchone(sql, (self.id,)) | ||
|
||
# Get the info from the dynamic table, including reference used | ||
sql = """SELECT * from qiita.{0} |
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.
I'm getting confused in this SQL query, it looks like it is enough to do:
SELECT * FROM qiita.{0}
JOIN qiita.reference USING (reference_id)
WHERE processed_params_id = {1}
I think this SQL query can return only a single value, since there will be only one row with the given processed_params_id.
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.
Yeah, was being way to protective about the join screwing up. Changed.
Few comments @squirrelo Thanks! |
All comments addressed, ready for another round of review. |
Can this get a quick final review? It's holding up the remaining work needed to create the cart. |
@squirrelo code looks good but the /study/description page is broken. Just log in with the default user and try to see the description of the test study. The page doesn't render. It works on master so it is something on this PR... |
@squirrelo I just saw the traceback on the CLI:
Probably useful to do a search over |
Did, just missed that one. Good catch. |
<h2><a href="/study/description/{{sid}}">{{study.title}}</a></h2> | ||
<table class='table table-striped' id='study{{sid}}-table'> | ||
<tr> | ||
<th></th><th>id</th><th>Datatype</th><th>Processed Date</th><th>Algorithm</th><th>Reference</th><th></th> |
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.
Can we change the id
by Processed data id
? The issue is that in the actual page we don't know what is that id for, is not completely clear...
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.
Also, is it possible to add a modal that will show the full list of parameters used to process data processed data? I can see this really useful to further samples/processed data filtering
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.
Can we move the show/hide samples at the end of the table, is more natural IMOO
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.
I had it there, but the samples come up on the very left so it's more natural to hit the link and then immediately scroll down.
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.
I can add the rest of the changes though
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.
Interface changes made, ready for another review. |
All set for another round. |
Thanks @squirrelo one more comment. Instead of adding the info gif that you used, can you use glyphicon glyphicon-info-sign? I think it will be more consistent with other icons on the system |
Oh, yeah that makes sense. |
Closing to open as a pull request on a separate branch. |
This pull request creates the carts for each user and the cart viewing page. Major pieces are:
Analysis.get_user_default(User)
function added to get the default analysis for a userprocessed_data.processing_info
added to get processing information needed for cart display.This is the final piece needed before tying everything together from the last few pull requests into a single unified sample selection system.