Skip to content

Commit ae1942f

Browse files
Best fix (#3)
Fixes the problem by cding and supplying a flag to mypy (that mypy needs this flag is seemingly fixed/changed in later versions of mypy; but that's another pr altogether...). Also fixes a type error that was somehow in the arguments of the program (?!) (I guess this is because you guys are still using implicit optional) --------- Signed-off-by: wyattscarpenter <[email protected]>
1 parent f1ee456 commit ae1942f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/code-quality-checks.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,6 @@ jobs:
161161
#----------------------------------------------
162162
- name: Mypy
163163
run: |
164+
cd src # Need to be in the actual databricks/ folder or mypy does the wrong thing.
164165
mkdir .mypy_cache # Workaround for bad error message "error: --install-types failed (no mypy cache directory)"; see https://github.com/python/mypy/issues/10768#issuecomment-2178450153
165-
poetry run mypy --install-types --non-interactive src/databricks
166+
poetry run mypy --config-file ../pyproject.toml --install-types --non-interactive --namespace-packages databricks

src/databricks/sql/utils.py

100644100755
+6-7
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def __init__(
134134
schema_bytes,
135135
max_download_threads: int,
136136
start_row_offset: int = 0,
137-
result_links: List[TSparkArrowResultLink] = None,
137+
result_links: List[TSparkArrowResultLink] = [],
138138
lz4_compressed: bool = True,
139139
description: List[List[Any]] = None,
140140
):
@@ -161,13 +161,12 @@ def __init__(
161161
start_row_offset
162162
)
163163
)
164-
if result_links is not None:
165-
for result_link in result_links:
166-
logger.debug(
167-
"- start row offset: {}, row count: {}".format(
168-
result_link.startRowOffset, result_link.rowCount
169-
)
164+
for result_link in result_links:
165+
logger.debug(
166+
"- start row offset: {}, row count: {}".format(
167+
result_link.startRowOffset, result_link.rowCount
170168
)
169+
)
171170

172171
self.download_manager = ResultFileDownloadManager(
173172
self.max_download_threads, self.lz4_compressed

0 commit comments

Comments
 (0)