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

Fixes unit test for newer versions of psycopg2. #163

Merged
merged 1 commit into from
Jun 13, 2019

Conversation

chanchiem
Copy link
Contributor

@chanchiem chanchiem commented Jun 11, 2019

Version 2.8.0 of Psycopg2 introduces granular errors for queries. This commit fixes a unit test to assert on the specific error instead of the now-updated base class. Functionally, the patcher still works fine with the latest versions of Psycopg2.

The previous matching class was ProgrammingError. For the specific test, it is now UndefinedColumn, which is a subclass of ProgrammingError.

Issue #, if available:
#159

Description of changes:
Modified test to check for UndefinedColumn instead of ProgrammingError.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Version 2.8.0 of Psycopg2 introduces more granular errors
for queries. This commit fixes a unit test to assert on
the specific error instead of the now-updated base class.

The previous matching class was ProgrammingError.
For the specific test, it is now UndefinedColumn,
which is a subclass of ProgrammingError.
@yogiraj07
Copy link
Contributor

Sanity check : Do we need to do modification in AWS SDK handler w.r.t to this change?

@chanchiem
Copy link
Contributor Author

Nope this was a pure test error. Basically, Psycopg2 was updated so that they have more exceptions, so the only change that this'll do is that there are more types of exceptions that can be caught and stored in the segment.

@chanchiem chanchiem merged commit 6a2126d into aws:master Jun 13, 2019
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.

2 participants