@@ -341,7 +341,7 @@ def cursor(
341341 self ,
342342 arraysize : int = DEFAULT_ARRAY_SIZE ,
343343 buffer_size_bytes : int = DEFAULT_RESULT_BUFFER_SIZE_BYTES ,
344- row_limit : int = None ,
344+ row_limit : Optional [ int ] = None ,
345345 ) -> "Cursor" :
346346 """
347347 Return a new Cursor object using the connection.
@@ -400,22 +400,23 @@ def __init__(
400400 visible by other cursors or connections.
401401 """
402402
403- if not self .connection .session .use_sea and row_limit is not None :
403+ self .connection : Connection = connection
404+
405+ if not connection .session .use_sea and row_limit is not None :
404406 logger .warning (
405407 "Row limit is only supported for SEA protocol. Ignoring row_limit."
406408 )
407409
408- self .connection = connection
409- self .rowcount = - 1 # Return -1 as this is not supported
410- self .buffer_size_bytes = result_buffer_size_bytes
410+ self .rowcount : int = - 1 # Return -1 as this is not supported
411+ self .buffer_size_bytes : int = result_buffer_size_bytes
411412 self .active_result_set : Union [ResultSet , None ] = None
412- self .arraysize = arraysize
413- self .row_limit = row_limit
413+ self .arraysize : int = arraysize
414+ self .row_limit : Optional [ int ] = row_limit
414415 # Note that Cursor closed => active result set closed, but not vice versa
415- self .open = True
416- self .executing_command_id = None
417- self .backend = backend
418- self .active_command_id = None
416+ self .open : bool = True
417+ self .executing_command_id : Optional [ CommandId ] = None
418+ self .backend : DatabricksClient = backend
419+ self .active_command_id : Optional [ CommandId ] = None
419420 self .escaper = ParamEscaper ()
420421 self .lastrowid = None
421422
0 commit comments