Skip to content

Unify metadata creation #1032

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

Merged
merged 10 commits into from
Apr 2, 2015

Conversation

josenavas
Copy link
Contributor

The code that was adding SQL statements to the queue was duplicated between the PrepTemplate and the SampleTemplate. I moved this code to the base class so future changes in this code are centralized...

Fixes #440

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 79.19% when pulling fe3eb14 on josenavas:unify-metadata-creation into 0a04779 on biocore:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 79.19% when pulling 4ae5c62 on josenavas:unify-metadata-creation into 0a04779 on biocore:master.

@josenavas
Copy link
Contributor Author

Do not merge this, I'm adding a test as per @antgonza request

@josenavas
Copy link
Contributor Author

This includes the commits from #1033. Once that one gets merged, I will pull from upstream/master and push again, so the commits will go away and only the new code is being shown here.

I've added a test for the _add_common_creation_steps_to_queue in both the SampleTemplate and PrepTemplate classes. This has been a good exercise as I was able to make sure that the SQL commands where correctly formatted directly, rather than relying on the database contests to assume that they're formatted correctly. I would suggest that we should do this when possible, as it will reduce potential issues with DB integrity and also it will help us to get a better view of how everything on the DB works :-)

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling aff06a3 on josenavas:unify-metadata-creation into * on biocore:master*.

@antgonza
Copy link
Member

antgonza commented Apr 2, 2015

👍

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 2ae8609 on josenavas:unify-metadata-creation into * on biocore:master*.

@josenavas
Copy link
Contributor Author

Ready for another review/merge if there are no comments!

headers = list(md_template.keys())

# Get the required columns from the DB
db_cols = get_table_cols(cls._table, conn_handler)
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks looks like the function needs the "am I instantiating the base class" test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking on that, but this is a private function and it should be only used in the create functions, that already have that test. If you feel strong about it, I can add it though...

Copy link
Contributor

Choose a reason for hiding this comment

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

Would probably be good to add as a safety layer, since it will also mean a more interpretable error.

@squirrelo
Copy link
Contributor

Few comments.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 79.18% when pulling 73502d0 on josenavas:unify-metadata-creation into 9068d4c on biocore:master.

@josenavas
Copy link
Contributor Author

@squirrelo, @antgonza already gave his 👍 if you think the code looks good can you merge? Thanks!

squirrelo added a commit that referenced this pull request Apr 2, 2015
@squirrelo squirrelo merged commit 0744eed into qiita-spots:master Apr 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify code on metadata_template
4 participants