|
140 | 140 | from __future__ import annotations |
141 | 141 |
|
142 | 142 | import logging |
143 | | -from typing import Any, Callable, Collection, TypeVar |
| 143 | +from typing import Any, Callable, Collection, Optional, TypeVar |
144 | 144 |
|
145 | 145 | import psycopg # pylint: disable=import-self |
146 | 146 | from psycopg.sql import Composed # pylint: disable=no-name-in-module |
@@ -241,7 +241,7 @@ def _uninstrument(self, **kwargs: Any): |
241 | 241 | @staticmethod |
242 | 242 | def instrument_connection( |
243 | 243 | connection: psycopg.Connection, |
244 | | - tracer_provider: typing.Optional[trace_api.TracerProvider] = None, |
| 244 | + tracer_provider: Optional[trace_api.TracerProvider] = None, |
245 | 245 | enable_commenter: bool = False, |
246 | 246 | commenter_options: dict = None, |
247 | 247 | enable_attribute_commenter: bool = False, |
@@ -361,8 +361,8 @@ def get_statement(self, cursor: CursorT, args: list[Any]) -> str: |
361 | 361 |
|
362 | 362 | def _new_cursor_factory( |
363 | 363 | db_api: dbapi.DatabaseApiIntegration = None, |
364 | | - base_factory: pg_cursor = None, |
365 | | - tracer_provider: typing.Optional[trace_api.TracerProvider] = None, |
| 364 | + base_factory: psycopg.Cursor = None, |
| 365 | + tracer_provider: Optional[trace_api.TracerProvider] = None, |
366 | 366 | enable_commenter: bool = False, |
367 | 367 | commenter_options: dict = None, |
368 | 368 | enable_attribute_commenter: bool = False, |
|
0 commit comments