Skip to content

Comments

psycopg2: Patch all imports of register_type#393

Merged
palazzem merged 3 commits intoDataDog:masterfrom
stj:master
Jan 19, 2018
Merged

psycopg2: Patch all imports of register_type#393
palazzem merged 3 commits intoDataDog:masterfrom
stj:master

Conversation

@stj
Copy link

@stj stj commented Jan 10, 2018

register_type was patched in #96, though only in psycopg.extensions.
The function is defined in psycopg2._psycopg and imported in psycopg2._json
neither of them are patched and if used cause a TypeError.

Stefan Tjarks added 3 commits January 11, 2018 09:35
`register_type` was patched in #96, though only in psycopg.extensions.
The function is defined in psycopg2._psycopg and imported in psycopg2._json
neither of them are patched and if used cause a TypeError.
this function does c-level checks of the type of the argument
so it must be a raw psycopg connection passed in. This adds
a hook to transparently downgrade.
Versions checked are:
 - redis
 - aiohttp
 - psycopg2
 - gevent
 - requests
 - sqlalchemy

Added new versions when latest is not tested.
@palazzem palazzem added this to the 0.10.1 milestone Jan 19, 2018
@palazzem palazzem self-requested a review January 19, 2018 22:52
Copy link

@palazzem palazzem left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this contribution @stj we'll land it in the next release!

@palazzem palazzem merged commit bff3c78 into DataDog:master Jan 19, 2018
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.

2 participants