File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
packages/databricks-vscode/resources/python Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 44from typing import Any , Union , List
55import os
66import sys
7- import time
7+ # Avoid conflicts with possible "datetime" imports (in the user code)
8+ import time as _time
89import shlex
910import warnings
1011import tempfile
@@ -388,7 +389,7 @@ def __init__(
388389 ) -> None :
389390 self ._ticks = None
390391 self ._tick = None
391- self ._started = time .time ()
392+ self ._started = _time .time ()
392393 self ._bytes_read = 0
393394 self ._running = 0
394395 self .init_ui ()
@@ -429,7 +430,7 @@ def update_ticks(
429430 def output (self ) -> None :
430431 if self ._tick is not None and self ._ticks is not None :
431432 percent_complete = (self ._tick / self ._ticks ) * 100
432- elapsed = int (time .time () - self ._started )
433+ elapsed = int (_time .time () - self ._started )
433434 scanned = self ._bytes_to_string (self ._bytes_read )
434435 running = self ._running
435436 self .w_progress .value = percent_complete
@@ -446,8 +447,9 @@ def _bytes_to_string(size: int) -> str:
446447
447448 class ProgressHandler :
448449 def __init__ (self ):
449- self .op_id = ""
450-
450+ self .p = None
451+ self .op_id = ""
452+
451453 def reset (self ):
452454 self .p = Progress ()
453455
@@ -460,7 +462,7 @@ def __call__(self,
460462 if len (stages ) == 0 :
461463 return
462464
463- if self .op_id != operation_id :
465+ if self .op_id != operation_id or not self . p :
464466 self .op_id = operation_id
465467 self .reset ()
466468
You can’t perform that action at this time.
0 commit comments