Skip to content

Unify template validation #1043

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 9, 2015

Conversation

josenavas
Copy link
Contributor

Moves the function _clean_validate_template to the base class in order to remove code duplication. Tests added to both subclasses.

@josenavas
Copy link
Contributor Author

It looks like one of my previous PR introduced a potential stochastic failure in the system; since it is a test that relies in a dict order. I'm going to solve it as a separate PR and then I'll pull here.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 77afb1c on josenavas:unify-template-validation into * on biocore:master*.

@josenavas
Copy link
Contributor Author

💥 ready for review!


# Check that we don't have duplicate columns
if len(set(md_template.columns)) != len(md_template.columns):
raise QiitaDBDuplicateHeaderError(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey, just noticed that this error message is not going to be very information (and it is not your fault, the code was like this already). If possible can you change to something along the lines of: 'The following header names are duplicated: %s' % ', '.join(find_duplicates(md_template.columns))

Copy link
Contributor

Choose a reason for hiding this comment

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

Nix that, QiitaDBDuplicateHeaderError already takes care of that formatting.

@ElDeveloper
Copy link
Contributor

Looks really good, just one comment, and if another person can have a look, this should be ready to be merged.

@ElDeveloper
Copy link
Contributor

Also, just noticed this has conflicts now, probably my bad :-\

@josenavas
Copy link
Contributor Author

Thanks @ElDeveloper , conflicts solved

@ElDeveloper
Copy link
Contributor

Thanks! This one needs one more reviewer and should be ready to go! It's a really quick one 🕐

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 79.0% when pulling 418a71e on josenavas:unify-template-validation into adff033 on biocore:master.

@josenavas
Copy link
Contributor Author

ping @biocore/qiita-dev I would appreciate a review on all my PR, but specially this one. The changes are starting creating merge conflicts between them.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 79.0% when pulling fbff71c on josenavas:unify-template-validation into 3ad2264 on biocore:master.

cls._check_subclass()
invalid_ids = get_invalid_sample_names(md_template.index)
if invalid_ids:
raise QiitaDBColumnError("The following sample names in the sample"
Copy link
Contributor

Choose a reason for hiding this comment

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

...in the template... (remove sample)

@squirrelo
Copy link
Contributor

Couple questions/comments.

@josenavas
Copy link
Contributor Author

@squirrelo addressed/commented

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 79.0% when pulling acb76ff on josenavas:unify-template-validation into 3ad2264 on biocore:master.

squirrelo added a commit that referenced this pull request Apr 9, 2015
@squirrelo squirrelo merged commit 0d65c9d into qiita-spots:master Apr 9, 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.

4 participants