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

Investigate why test_psycopg2 is failing with "UndefinedColumn" instead of "ProgrammingError" #159

Closed
chanchiem opened this issue Jun 3, 2019 · 2 comments
Labels

Comments

@chanchiem
Copy link
Contributor

chanchiem commented Jun 3, 2019

The test for some reason now is failing. This is aside from any recent changes that we've made.

...
        exception = subsegment.cause['exceptions'][0]
>       assert exception.type == 'ProgrammingError'
E       AssertionError: assert 'UndefinedColumn' == 'ProgrammingError'
E         - UndefinedColumn
E         + ProgrammingError
tests/ext/psycopg2/test_psycopg2.py:147: AssertionError
...

We re-ran the test for a build that had previously worked and now it appears to be failing. This issue is made to investigate this and will be updated when further information is found.

Please refer to this link for the build re-run of a previously passing build.

chanchiem added a commit that referenced this issue Jun 3, 2019
Enable test with Python3.7; there's an issue to track the failing test that appears to be perpendicular to this pull request: #159
@chanchiem chanchiem added the bug label Jun 3, 2019
@chanchiem
Copy link
Contributor Author

chanchiem commented Jun 11, 2019

In version 2.8.0 of Psycopg2, they announced the following:
Added errors module. Every PostgreSQL error is converted into a specific exception class (ticket #682).

This means that they added granular error exception classes, so the exception that we originally tested for (ProgrammingError) is now a base class exception for what was previously tested. In particular, the test that we originally wrote tested for a bad query whose database column doesn't exist, hence why we are now seeing UndefinedColumn exceptions. The UndefinedColumn class is inherited from the ProgrammingError class.

Here is a list of all the mappings from the base classes.

This seems to be only an issue with the test. Psycopg2 seems to function fine when instrumented with X-Ray

@chanchiem
Copy link
Contributor Author

Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant