Skip to content

[psycopg2] The prepare functions require psycopg2.extensions.connection. #383

@Prillan

Description

@Prillan

Here is an example:

from ddtrace import patch_all

patch_all()

import psycopg2
from psycopg2.extensions import adapt

conn = psycopg2.connect(dbname="test")

items = adapt([1, 2, 3])
items.prepare(conn) # Fails here

binary = adapt(b'12345')
binary.prepare(conn) # and here.
$ python example.py
Traceback (most recent call last):
  File "example.py", line 11, in <module>
    items.prepare(conn)
TypeError: argument 1 must be psycopg2.extensions.connection, not TracedConnection

This could probably be solved in a similar manner to #96 .

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions