Skip to content

Commit

Permalink
Add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi committed Nov 19, 2024
1 parent 7fabfcf commit 83f8e67
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@


class BaseTracedConnectionProxy(ABC, wrapt.ObjectProxy):
"""ABC for traced database client connection proxy.
Child classes are used to wrap Connection objects and
generate telemetry based on provided integration settings.
Child classes must implement cursor(), which should return
a traced database client cursor proxy depending on database
driver needs.
"""

# pylint: disable=unused-argument
def __init__(self, connection, *args, **kwargs):
wrapt.ObjectProxy.__init__(self, connection)
Expand All @@ -45,6 +55,15 @@ def __exit__(self, *args, **kwargs):

# pylint: disable=abstract-method
class BaseTracedCursorProxy(ABC, wrapt.ObjectProxy):
"""ABC for traced database client cursor proxy.
Child classes are used to wrap Cursor objects and
generate telemetry based on provided integration settings.
Child classes must implement __init__(), which should set
a CursorTracer depending on database driver needs.
"""

# pylint: disable=unused-argument
@abstractmethod
def __init__(self, cursor, *args, **kwargs):
Expand Down

0 comments on commit 83f8e67

Please sign in to comment.