Skip to content

Commit

Permalink
Merge pull request #83 from juntossomosmais/fix/database-error
Browse files Browse the repository at this point in the history
fix(dbapi): remove string interpolation in self.db_info
  • Loading branch information
dlopes7 authored Aug 23, 2023
2 parents 1c26667 + 1d53570 commit e49966e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ __pycache__
*.pyc
.tox/
autodynatrace.egg-info/
.idea
2 changes: 1 addition & 1 deletion autodynatrace/wrappers/dbapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class TracedCursor(wrapt.ObjectProxy):
def __init__(self, cursor, db_info):
super(TracedCursor, self).__init__(cursor)
self.db_info = f"{db_info}"
self.db_info = db_info
self._self_last_execute_operation = None
self._original_cursor = cursor

Expand Down
2 changes: 1 addition & 1 deletion autodynatrace/wrappers/psycopg2/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.extra.DictCursorBase):
class DynatraceCursor(psycopg2.extensions.cursor):
def __init__(self, *args, **kwargs):
self._dynatrace_db_info = kwargs.pop("dynatrace_db_info", None)
super(DynatraceCursor, self).__init__(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="autodynatrace",
version="2.0.0",
version="2.0.1",
packages=find_packages(),
package_data={"autodynatrace": ["wrappers/*"]},
install_requires=["wrapt>=1.11.2", "oneagent-sdk>=1.3.0", "six>=1.10.0", "autowrapt>=1.0"],
Expand Down

0 comments on commit e49966e

Please sign in to comment.