108108"""
109109
110110import logging
111+ import typing
111112from importlib import import_module
112- from typing import (
113- Any ,
114- Callable ,
115- Collection ,
116- Dict ,
117- Optional ,
118- Tuple ,
119- )
120113
121114import mysql .connector
122115import wrapt
@@ -142,7 +135,7 @@ class MySQLInstrumentor(BaseInstrumentor):
142135
143136 _DATABASE_SYSTEM = "mysql"
144137
145- def instrumentation_dependencies (self ) -> Collection [str ]:
138+ def instrumentation_dependencies (self ) -> typing . Collection [str ]:
146139 return _instruments
147140
148141 def _instrument (self , ** kwargs ):
@@ -174,7 +167,7 @@ def _uninstrument(self, **kwargs):
174167 def instrument_connection (
175168 self ,
176169 connection ,
177- tracer_provider : Optional [trace_api .TracerProvider ] = None ,
170+ tracer_provider : typing . Optional [trace_api .TracerProvider ] = None ,
178171 enable_commenter : bool = False ,
179172 commenter_options : dict = None ,
180173 ):
@@ -225,9 +218,9 @@ def uninstrument_connection(
225218class DatabaseApiIntegration (dbapi .DatabaseApiIntegration ):
226219 def wrapped_connection (
227220 self ,
228- connect_method : Callable [..., Any ],
229- args : Tuple [Any , Any ],
230- kwargs : Dict [Any , Any ],
221+ connect_method : typing . Callable [..., typing . Any ],
222+ args : typing . Tuple [typing . Any , typing . Any ],
223+ kwargs : typing . Dict [typing . Any , typing . Any ],
231224 ):
232225 """Add object proxy to connection object."""
233226 connection = connect_method (* args , ** kwargs )
0 commit comments