Skip to content

Commit 0dad966

Browse files
clean up conversion code
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 4be6808 commit 0dad966

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

src/databricks/sql/backend/sea/result_set.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,8 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
204204

205205
results = self.results.next_n_rows(size)
206206
if isinstance(self.results, JsonQueue):
207-
# Transform JSON first, then convert to Arrow
208-
transformed_json = self._normalise_json_metadata_cols(results)
209-
results = self._convert_json_to_arrow_table(transformed_json)
210-
else:
211-
# Transform Arrow table directly
212-
results = self._normalise_arrow_metadata_cols(results)
207+
results = self._convert_json_to_arrow_table(results)
208+
results = self._normalise_arrow_metadata_cols(results)
213209

214210
self._next_row_index += results.num_rows
215211

@@ -222,12 +218,8 @@ def fetchall_arrow(self) -> "pyarrow.Table":
222218

223219
results = self.results.remaining_rows()
224220
if isinstance(self.results, JsonQueue):
225-
# Transform JSON first, then convert to Arrow
226-
transformed_json = self._normalise_json_metadata_cols(results)
227-
results = self._convert_json_to_arrow_table(transformed_json)
228-
else:
229-
# Transform Arrow table directly
230-
results = self._normalise_arrow_metadata_cols(results)
221+
results = self._convert_json_to_arrow_table(results)
222+
results = self._normalise_arrow_metadata_cols(results)
231223

232224
self._next_row_index += results.num_rows
233225

src/databricks/sql/backend/sea/utils/conversion.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ def convert_value(
159159
The converted value in the appropriate Python type
160160
"""
161161

162-
# Handle None values directly
163-
if value is None:
164-
return None
165-
166162
sql_type = sql_type.lower().strip()
167163

168164
if sql_type not in SqlTypeConverter.TYPE_MAPPING:

0 commit comments

Comments
 (0)