-
Notifications
You must be signed in to change notification settings - Fork 80
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
WIP: Fix DOI issues #2009
WIP: Fix DOI issues #2009
Conversation
Looks good to me
…On Mon, Dec 5, 2016 at 3:04 PM, Antonio Gonzalez ***@***.***> wrote:
Fixing DOI issues both in code & GUI and deleted add_publications cause is
not used anywhere and doesn't apply with the new methods.
The new edit/create study looks like:
[image: screen shot 2016-12-05 at 3 48 50 pm]
<https://cloud.githubusercontent.com/assets/2014559/20906242/4a2488d4-bb04-11e6-9bb3-ba72c9c5366f.png>
Missing stuff:
- all tests pass?
- add new db html/dbs
------------------------------
You can view, comment on, or merge this pull request online at:
#2009
Commit Summary
- fix #1993, fix #1248
File Changes
- *M* qiita_db/study.py
<https://github.com/biocore/qiita/pull/2009/files#diff-0> (66)
- *A* qiita_db/support_files/patches/44.sql
<https://github.com/biocore/qiita/pull/2009/files#diff-1> (19)
- *A* qiita_db/support_files/patches/python_patches/44.py
<https://github.com/biocore/qiita/pull/2009/files#diff-2> (34)
- *M* qiita_db/test/test_study.py
<https://github.com/biocore/qiita/pull/2009/files#diff-3> (30)
- *M* qiita_db/test/test_util.py
<https://github.com/biocore/qiita/pull/2009/files#diff-4> (2)
- *M* qiita_db/util.py
<https://github.com/biocore/qiita/pull/2009/files#diff-5> (25)
- *M* qiita_pet/handlers/api_proxy/studies.py
<https://github.com/biocore/qiita/pull/2009/files#diff-6> (8)
- *M* qiita_pet/handlers/api_proxy/tests/test_studies.py
<https://github.com/biocore/qiita/pull/2009/files#diff-7> (27)
- *M* qiita_pet/handlers/study_handlers/base.py
<https://github.com/biocore/qiita/pull/2009/files#diff-8> (11)
- *M* qiita_pet/handlers/study_handlers/edit_handlers.py
<https://github.com/biocore/qiita/pull/2009/files#diff-9> (29)
- *M* qiita_pet/handlers/study_handlers/listing_handlers.py
<https://github.com/biocore/qiita/pull/2009/files#diff-10> (12)
- *M* qiita_pet/handlers/study_handlers/tests/test_listing_handlers.py
<https://github.com/biocore/qiita/pull/2009/files#diff-11> (21)
- *M* qiita_pet/templates/edit_study.html
<https://github.com/biocore/qiita/pull/2009/files#diff-12> (4)
- *M* qiita_pet/templates/list_studies.html
<https://github.com/biocore/qiita/pull/2009/files#diff-13> (8)
Patch Links:
- https://github.com/biocore/qiita/pull/2009.patch
- https://github.com/biocore/qiita/pull/2009.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2009>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB69gOggDQn2fEJxLKSr_48mAgcLfQaOks5rFJhwgaJpZM4LE0pf>
.
--
Gail Ackermann
Knight Lab
UCSD
glackermann@ucsd.edu <ackermag@ucsd.edu>
|
Sorry for jumping in a bit earlier than needed, but your last commit catch my attention. Is there any specific reason that we need a newer version of psql? Note that I'm not opposing to it, but if that's is required we will need to do some updates across all our systems, so these kind of updates should be handled carefully... |
Updating cause 9.6 is what we have in the systems, and cause we need something newer to retrieve ARRAY. |
FROM qiita.study | ||
LEFT JOIN ( | ||
SELECT study_id, | ||
array_agg(ARRAY[publication::text, is_doi::text]) |
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 think all the issues that you're having started due to this call. Can you check if this construction helps addressing your issues w/o the need of changing the minimum version of postgres?
array_agg((publication, is_doi))
Note the double parenthesis. What do you think?
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.
Thanks for the suggestion. I tried that before and just retested but it returns a string, which I don't like but if people agree with this I can use literal_eval
from ast
.
OK, this is ready for review. I will like to hear back before changing the htmls for the DB, in case we need to change them again. Thanks! BTW I went back to postgres 9.3 as is what we have in our servers. |
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.
Minor comments on the patches
|
||
|
||
-- dropping PRIMARY KEY ( study_id, publication_doi ) | ||
ALTER TABLE qiita.study_publication DROP CONSTRAINT idx_study_publication_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.
Should a new primary key be added on publication?
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.
Thought about it and thought that study and is_doi should be it but at the same time I feel like it's not necessary, thus why I didn't add it. Please let me know if you feel strong about it.
|
||
|
||
# selecting all doi/pubmedids | ||
with qdb.sql_connection.TRN: |
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.
Any specific reason why this is executed in 2 different transactions?
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.
No, will merge all of them
LEFT JOIN qiita.publication AS p ON (sp.publication = p.doi) | ||
WHERE p.doi NOT IN ( | ||
SELECT publication_doi FROM qiita.software_publication)""" | ||
qdb.sql_connection.TRN.add(sql, []) |
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.
No need for the second parameter: qdb.sql_connection.TRN.add(sql)
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.
k
# deleting all references to start from scratch | ||
with qdb.sql_connection.TRN: | ||
sql = """DELETE FROM qiita.study_publication""" | ||
qdb.sql_connection.TRN.add(sql, []) |
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.
Same as above regarding the second parameter
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.
k
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.
Thanks for the reviews, one more question and I'll update the db schema
|
||
|
||
-- dropping PRIMARY KEY ( study_id, publication_doi ) | ||
ALTER TABLE qiita.study_publication DROP CONSTRAINT idx_study_publication_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.
Thought about it and thought that study and is_doi should be it but at the same time I feel like it's not necessary, thus why I didn't add it. Please let me know if you feel strong about it.
|
||
|
||
# selecting all doi/pubmedids | ||
with qdb.sql_connection.TRN: |
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.
No, will merge all of them
LEFT JOIN qiita.publication AS p ON (sp.publication = p.doi) | ||
WHERE p.doi NOT IN ( | ||
SELECT publication_doi FROM qiita.software_publication)""" | ||
qdb.sql_connection.TRN.add(sql, []) |
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.
k
# deleting all references to start from scratch | ||
with qdb.sql_connection.TRN: | ||
sql = """DELETE FROM qiita.study_publication""" | ||
qdb.sql_connection.TRN.add(sql, []) |
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.
k
Fixing DOI issues both in code & GUI and deleted add_publications cause is not used anywhere and doesn't apply with the new methods.
The new edit/create study looks like:
Missing stuff: