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

Transactionize the analysis and job objects #1332

Merged
merged 5 commits into from
Jul 7, 2015

Conversation

josenavas
Copy link
Contributor

The analysis and job object now use transactions.

I've been removing some SQL queries to use convert_to_id in a couple of places.

@josenavas josenavas added this to the Alpha 0.2 milestone Jul 6, 2015
@josenavas josenavas mentioned this pull request Jul 6, 2015
28 tasks
@josenavas
Copy link
Contributor Author

This have the same failure as #1326
Once it gets merged I will pull from upstream/transaction and the failure will go away, so this is safe to review

@antgonza
Copy link
Member

antgonza commented Jul 7, 2015

This looks fine. 👍

"ans.status = %s".format(cls._table))
return {x[0] for x in conn_handler.execute_fetchall(sql, (status,))}
with TRN:
sql = """SELECT analysis_id
Copy link
Contributor

Choose a reason for hiding this comment

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

This indentation is odd, and this SQL should also be changed to use USING. Standard SQL indentation is:

SELECT analysis_id  FROM qiita.{0}
JOIN qiita.{0}_status USING (analysis_status_id)
WHERE ans.status = %s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@squirrelo can you point to the "standard" that you're talking about? There is no standard, only coding guidelines (that we can user or not) but None of the ones that I've seen use your indentation. Usually is common practice to put the FROM in the next line under the SELECT, not following it (quick googling will show this to you...)

I can agree on adding the JOIN in a single line but it didn't fit. Will change for USING.

@squirrelo
Copy link
Contributor

Some SQL cleanup that needs to be done (not your fault but good to do since this pull request is going in to clean things up anyway). Other than that, looks good.

@josenavas
Copy link
Contributor Author

@squirrelo comments addressed

@squirrelo
Copy link
Contributor

👍

squirrelo added a commit that referenced this pull request Jul 7, 2015
Transactionize the analysis and job objects
@squirrelo squirrelo merged commit 1c4db37 into qiita-spots:transaction Jul 7, 2015
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.

3 participants