From 49091a048dac1c550399fed4460e81034e5a384c Mon Sep 17 00:00:00 2001 From: dlopes7 Date: Thu, 22 Jun 2023 07:06:55 -0500 Subject: [PATCH] Fix #76 - psycopg2 cursors not working when using Dict cursors --- autodynatrace/wrappers/psycopg2/wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autodynatrace/wrappers/psycopg2/wrapper.py b/autodynatrace/wrappers/psycopg2/wrapper.py index 0693fc6..e1d722c 100644 --- a/autodynatrace/wrappers/psycopg2/wrapper.py +++ b/autodynatrace/wrappers/psycopg2/wrapper.py @@ -11,7 +11,7 @@ def instrument(): def parse_dsn(dsn): return {c.split("=")[0]: c.split("=")[1] for c in dsn.split() if "=" in c} - class DynatraceCursor(psycopg2.extensions.cursor): + class DynatraceCursor(psycopg2.extra.DictCursorBase): def __init__(self, *args, **kwargs): self._dynatrace_db_info = kwargs.pop("dynatrace_db_info", None) super(DynatraceCursor, self).__init__(*args, **kwargs)