44import asyncio
55import logging
66from multiprocessing import cpu_count
7- from typing import TYPE_CHECKING , Any , Callable , Dict , List , Optional , Union , cast
7+ from typing import TYPE_CHECKING , Any , Dict , List , Optional , Union , cast
88
99from pyathena .aio .common import WithAsyncFetch
1010from pyathena .common import CursorIterator
@@ -50,7 +50,6 @@ def __init__(
5050 unload : bool = False ,
5151 result_reuse_enable : bool = False ,
5252 result_reuse_minutes : int = CursorIterator .DEFAULT_RESULT_REUSE_MINUTES ,
53- on_start_query_execution : Optional [Callable [[str ], None ]] = None ,
5453 block_size : Optional [int ] = None ,
5554 cache_type : Optional [str ] = None ,
5655 max_workers : int = (cpu_count () or 1 ) * 5 ,
@@ -68,7 +67,6 @@ def __init__(
6867 kill_on_interrupt = kill_on_interrupt ,
6968 result_reuse_enable = result_reuse_enable ,
7069 result_reuse_minutes = result_reuse_minutes ,
71- on_start_query_execution = on_start_query_execution ,
7270 ** kwargs ,
7371 )
7472 self ._unload = unload
@@ -97,7 +95,6 @@ async def execute( # type: ignore[override]
9795 result_reuse_enable : Optional [bool ] = None ,
9896 result_reuse_minutes : Optional [int ] = None ,
9997 paramstyle : Optional [str ] = None ,
100- on_start_query_execution : Optional [Callable [[str ], None ]] = None ,
10198 ** kwargs ,
10299 ) -> "AioPolarsCursor" :
103100 """Execute a SQL query asynchronously and return results as Polars DataFrames.
@@ -112,7 +109,6 @@ async def execute( # type: ignore[override]
112109 result_reuse_enable: Enable Athena result reuse for this query.
113110 result_reuse_minutes: Minutes to reuse cached results.
114111 paramstyle: Parameter style ('qmark' or 'pyformat').
115- on_start_query_execution: Callback called when query starts.
116112 **kwargs: Additional execution parameters passed to Polars read functions.
117113
118114 Returns:
@@ -143,10 +139,6 @@ async def execute( # type: ignore[override]
143139 paramstyle = paramstyle ,
144140 )
145141
146- if self ._on_start_query_execution :
147- self ._on_start_query_execution (self .query_id )
148- if on_start_query_execution :
149- on_start_query_execution (self .query_id )
150142 query_execution = await self ._poll (self .query_id )
151143 if query_execution .state == AthenaQueryExecution .STATE_SUCCEEDED :
152144 self .result_set = await asyncio .to_thread (
0 commit comments