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

WIP: Fix DOI issues #2009

Merged
merged 8 commits into from
Dec 16, 2016
Merged

WIP: Fix DOI issues #2009

merged 8 commits into from
Dec 16, 2016

Conversation

antgonza
Copy link
Member

@antgonza antgonza commented Dec 5, 2016

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:

screen shot 2016-12-05 at 3 48 50 pm

Missing stuff:

  • all tests pass?
  • add new db html/dbs

@ackermag
Copy link

ackermag commented Dec 5, 2016 via email

@josenavas
Copy link
Contributor

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...

@antgonza
Copy link
Member Author

antgonza commented Dec 5, 2016

Updating cause 9.6 is what we have in the systems, and cause we need something newer to retrieve ARRAY.

@ElDeveloper ElDeveloper self-requested a review December 7, 2016 22:28
FROM qiita.study
LEFT JOIN (
SELECT study_id,
array_agg(ARRAY[publication::text, is_doi::text])
Copy link
Contributor

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?

Copy link
Member Author

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.

@antgonza
Copy link
Member Author

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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0009%) to 91.447% when pulling 42ba6b3 on antgonza:fix-doi into 490045f on biocore:master.

Copy link
Contributor

@josenavas josenavas left a 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;
Copy link
Contributor

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?

Copy link
Member Author

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:
Copy link
Contributor

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?

Copy link
Member Author

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, [])
Copy link
Contributor

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)

Copy link
Member Author

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, [])
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

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

k

Copy link
Member Author

@antgonza antgonza left a 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;
Copy link
Member Author

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:
Copy link
Member Author

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, [])
Copy link
Member Author

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, [])
Copy link
Member Author

Choose a reason for hiding this comment

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

k

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 91.457% when pulling 8eb160a on antgonza:fix-doi into c5c38a6 on biocore:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 91.457% when pulling 4151658 on antgonza:fix-doi into c5c38a6 on biocore:master.

@josenavas josenavas merged commit c0b5a6f into qiita-spots:master Dec 16, 2016
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

Successfully merging this pull request may close these issues.

5 participants