Skip to content

Commit

Permalink
Rm psycopg2 wrapt dep
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi committed Dec 5, 2024
1 parent ea8d73d commit a0f74ca
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
from typing import Collection

import psycopg2
import wrapt
from psycopg2.extensions import (
cursor as pg_cursor, # pylint: disable=no-name-in-module
)
Expand Down Expand Up @@ -168,10 +167,9 @@ def instrument_connection(
enable_commenter: bool = False,
commenter_options: dict = None,
):
if isinstance(connection, wrapt.ObjectProxy):
# The connection is already instrumented from wrapt.wrap_function_wrapper
# of the psycopg2 module's `connect` method by DB-API `wrap_connect`,
# so the Psycopg2Instrumentor is marked as instrumenting.
if self._is_instrumented_by_opentelemetry:
# _instrument (via BaseInstrumentor) or instrument_connection (this)
# was already called
_logger.warning(
"Attempting to instrument Psycopg connection while already instrumented"
)
Expand Down

0 comments on commit a0f74ca

Please sign in to comment.