-
Couldn't load subscription status.
- Fork 79
Adding archive #2449
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
Adding archive #2449
Conversation
Qiita Release December 22nd
…late-download Fixing download issue
Codecov Report
@@ Coverage Diff @@
## dev #2449 +/- ##
==========================================
+ Coverage 94.15% 94.17% +0.01%
==========================================
Files 164 166 +2
Lines 19445 19558 +113
==========================================
+ Hits 18308 18418 +110
- Misses 1137 1140 +3
Continue to review full report at Codecov.
|
|
Hey @antgonza thanks for your efforts. I am travelling with my family right now who will get quite angry if I start staring into my laptop. I might find some time in two days |
update dep versions to fix master
| env: | ||
| global: | ||
| - PYTHON_VERSION=2.7 | ||
| - PYTHON_VERSION=3.5 |
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.
Long story short: there is a bug in conda that the Qiime2 guys reported and this is the best way to install everything. See that these changes are in master and are passing.
qiita_db/archive.py
Outdated
| Raises | ||
| ------ | ||
| ValueError |
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.
extra tab
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.
removing
| If the Artifact type is not BIOM | ||
| If the artifact doesn't have a biom filepath | ||
| """ | ||
| 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.
seems like most of the logic contained can be done outside of the context?
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.
possible but I think it's better to leave it like this as some of these steps are actually accessing the DB so this assures that everything it's in the same transaction.
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. implicit operations remote resource operations? :/ okay.
| If the artifact doesn't have a biom filepath | ||
| """ | ||
| with qdb.sql_connection.TRN: | ||
| acmd = job.command |
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?
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 ... 😄
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.
off topic but how does a developer know whether a given qiita method (or property) will issue a 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.
I think the safest assumption is that any property/method from a Qiita object will issue a DB call ... as everything is store in there.
qiita_db/archive.py
Outdated
| Notes | ||
| ----- | ||
| If archive_merging_scheme is None it will return all |
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.
extra indent
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.
removing
| feature values | ||
| """ | ||
| with qdb.sql_connection.TRN: | ||
| extras = [] |
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?
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.
ya' know, same 😉
qiita_db/test/test_archive.py
Outdated
|
|
||
| # now let's tests that all the inserts happen as expected | ||
| exp = { | ||
| 'featureA4': '{valuesA: vA, int: 1}', |
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.
are these supposed to be json? if so, they're not as the strings "vA" and "vB" are not quoted, nor are the keys
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.
well, they are strings but supposedly represent json, I can change for test if you feel strongly about it.
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.
if this is stuff generated from the code, then it certainly is not generating json. if this is supposed to be json, should the data contained in the insertion logic validate that the data are json?
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 @wasade !
| env: | ||
| global: | ||
| - PYTHON_VERSION=2.7 | ||
| - PYTHON_VERSION=3.5 |
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.
Long story short: there is a bug in conda that the Qiime2 guys reported and this is the best way to install everything. See that these changes are in master and are passing.
qiita_db/archive.py
Outdated
| Raises | ||
| ------ | ||
| ValueError |
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.
removing
| If the Artifact type is not BIOM | ||
| If the artifact doesn't have a biom filepath | ||
| """ | ||
| 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.
possible but I think it's better to leave it like this as some of these steps are actually accessing the DB so this assures that everything it's in the same transaction.
| If the artifact doesn't have a biom filepath | ||
| """ | ||
| with qdb.sql_connection.TRN: | ||
| acmd = job.command |
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 ... 😄
qiita_db/archive.py
Outdated
| Notes | ||
| ----- | ||
| If archive_merging_scheme is None it will return all |
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.
removing
| feature values | ||
| """ | ||
| with qdb.sql_connection.TRN: | ||
| extras = [] |
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.
ya' know, same 😉
qiita_db/test/test_archive.py
Outdated
|
|
||
| # now let's tests that all the inserts happen as expected | ||
| exp = { | ||
| 'featureA4': '{valuesA: vA, int: 1}', |
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.
well, they are strings but supposedly represent json, I can change for test if you feel strongly about it.
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
qiita_db/archive.py
Outdated
| """ | ||
|
|
||
| @classmethod | ||
| def _inserting_main_steps(cls, TRN, ms, features): |
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 but there is no need to pass the TRN object by parameter. The system is using the singleton pattern, so using "with ...TRN:" should be good.
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.
| Methods | ||
| ------- | ||
| insert_from_biom |
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.
insert_from_artifact?
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.
yup
| self.assertEqual( | ||
| str(err.exception), 'To archive artifact must be BIOM but FASTQ') | ||
|
|
||
| # 7 - to test error due to not filepath biom |
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 is testing that an artifact of type BIOM doesn't have a BIOM? that seems like it should never happen.
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.
right, but I think an extra test never hurts ... anyway, want me to remove it?
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! @josenavas
| Methods | ||
| ------- | ||
| insert_from_biom |
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.
yup
qiita_db/archive.py
Outdated
| """ | ||
|
|
||
| @classmethod | ||
| def _inserting_main_steps(cls, TRN, ms, features): |
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.
| self.assertEqual( | ||
| str(err.exception), 'To archive artifact must be BIOM but FASTQ') | ||
|
|
||
| # 7 - to test error due to not filepath biom |
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.
right, but I think an extra test never hurts ... anyway, want me to remove it?
This adds the basic archiving code. @sjanssen2 and @josenavas, could you take a look so we can continue working on it? Thanks!