Skip to content

Transfer update delete templates #2274

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
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9481d42
Moving update_sample_template
josenavas Aug 31, 2017
998197e
Transfer update_sample_template
josenavas Sep 1, 2017
656ac7f
Porting update prep template
josenavas Sep 5, 2017
37a5a74
Moving delete sample or column
josenavas Sep 5, 2017
4a6b3b2
Removing tests
josenavas Sep 5, 2017
0aaa53f
Solving merge conflicts
josenavas Sep 5, 2017
6f52ebd
Removing dispatchable and its tests
josenavas Sep 5, 2017
c2e7d8b
Updating interface to use the new functionality'
josenavas Sep 5, 2017
c450079
Adapting the prep template GUI
josenavas Sep 5, 2017
22ce457
Submitting jobs
josenavas Sep 6, 2017
d2259b0
Fixing tests
josenavas Sep 6, 2017
6ec24d9
Removing qiita_ware/context.py
josenavas Sep 6, 2017
e9901ed
flake8ing
josenavas Sep 6, 2017
2019e71
Fixing _system_call
josenavas Sep 7, 2017
830312d
Safeguarding the call to rollback
josenavas Sep 7, 2017
3f4cdcd
Unmasking more errors
josenavas Sep 7, 2017
d9d51e6
Forcing different connections on different processes
josenavas Sep 7, 2017
4339eda
Moving job completion to internal plugin structure
josenavas Sep 7, 2017
fa391d0
Removing unused code
josenavas Sep 7, 2017
dd74e11
Forcing the creation of a new transaction on the jobs
josenavas Sep 7, 2017
407fd8b
Fixing tests
josenavas Sep 7, 2017
966eb0f
forcing the commit
josenavas Sep 7, 2017
1a4026c
Fixing all tests
josenavas Sep 7, 2017
dc960a3
Addressing @antgonza's comments
josenavas Sep 8, 2017
63519f6
Addressing @antgonza's comment
josenavas Sep 8, 2017
eb2d314
Addressing @ElDeveloper's comments
josenavas Sep 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Unmasking more errors
  • Loading branch information
josenavas committed Sep 7, 2017
commit 3f4cdcd322e93f2c96679c6a0f871378725a4ae7
9 changes: 6 additions & 3 deletions qiita_db/sql_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,12 @@ def _raise_execution_error(self, sql, sql_args, error):
"""
self.rollback()

raise ValueError(
"Error running SQL: %s. MSG: %s\n" % (
errorcodes.lookup(error.pgcode), error.message))
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

This block seems rather confusing, you try to find the error code, and check if that raises a KeyError, if it doesn't you show the error and the message, and if it does you just show the message. Are pgcodes not guaranteed to be in the errorcodes?

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 found one case in which pgcodes was not in the error codes. It was mainly due to a bad usage of psycopg2 and the multiprocessing module. That is now fixed, but without this try/except I was unable to see the error message. Thus, in general they will be found, but just in case that in the future we find another issue, this will allow us to debug.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, that's very strange!

ec_lu = errorcodes.lookup(error.pgcode)
raise ValueError(
"Error running SQL: %s. MSG: %s\n" % (ec_lu, error.message))
except KeyError:
raise ValueError("Error running SQL query: %s" % error.message)

@_checker
def add(self, sql, sql_args=None, many=False):
Expand Down