Skip to content

Commit 0499158

Browse files
committed
Timeout is never None
Signed-off-by: Matthew Kim <[email protected]>
1 parent 585bf4a commit 0499158

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/databricks/sql/cloudfetch/downloader.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def is_file_download_successful(self) -> bool:
5151
5252
This function will block until a file download finishes or until a timeout.
5353
"""
54-
timeout = self.settings.download_timeout
55-
timeout = timeout if timeout and timeout > 0 else None
54+
timeout = self.settings.download_timeout if self.settings.download_timeout > 0 else None
5655
try:
5756
if not self.is_download_finished.wait(timeout=timeout):
5857
self.is_download_timedout = True

tests/unit/test_downloader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def test_download_timeout(self, mock_time, mock_session):
136136

137137
@patch("threading.Event.wait", return_value=True)
138138
def test_is_file_download_successful_has_finished(self, mock_wait):
139-
for timeout in [None, 0, 1]:
139+
for timeout in [0, 1]:
140140
with self.subTest(timeout=timeout):
141141
settings = Mock(download_timeout=timeout)
142142
result_link = Mock()

0 commit comments

Comments
 (0)