From 073a31a981d202dab6bb057beae015da36457861 Mon Sep 17 00:00:00 2001 From: sroda Date: Sun, 15 Jan 2023 17:11:35 +0200 Subject: [PATCH] Fix lint --- .../src/opentelemetry/instrumentation/sqlalchemy/__init__.py | 5 +++-- .../src/opentelemetry/instrumentation/sqlalchemy/engine.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py index f86ef124d4..f9cebd044e 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py @@ -119,6 +119,8 @@ class SQLAlchemyInstrumentor(BaseInstrumentor): See `BaseInstrumentor` """ + engines = [] + def instrumentation_dependencies(self) -> Collection[str]: return _instruments @@ -159,7 +161,6 @@ def _instrument(self, **kwargs): _wrap_create_async_engine(tracer_provider, enable_commenter), ) - self.engines = [] if kwargs.get("engine") is not None: self.engines.append( EngineTracer( @@ -170,7 +171,7 @@ def _instrument(self, **kwargs): ) ) return self.engines[0] - elif kwargs.get("engines") is not None and isinstance( + if kwargs.get("engines") is not None and isinstance( kwargs.get("engines"), Sequence ): self.engines = [ diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py index e14293b831..62eba4b08d 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py @@ -14,10 +14,10 @@ import os import re -from sqlalchemy.event import ( +from sqlalchemy.event import ( # pylint: disable=no-name-in-module listen, remove, -) # pylint: disable=no-name-in-module +) from opentelemetry import trace from opentelemetry.instrumentation.sqlalchemy.package import (