Skip to content

Commit f75f2b5

Browse files
line breaks after multi line pydocs, remove excess logs
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent db7b8e5 commit f75f2b5

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

examples/experimental/tests/test_sea_async_query.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ def test_sea_async_query_with_cloud_fetch():
8282
results.extend(cursor.fetchmany(10))
8383
results.extend(cursor.fetchall())
8484
actual_row_count = len(results)
85-
logger.info(
86-
f"{actual_row_count} rows retrieved against {requested_row_count} requested"
87-
)
8885

8986
logger.info(
9087
f"Requested {requested_row_count} rows, received {actual_row_count} rows"
@@ -188,9 +185,6 @@ def test_sea_async_query_without_cloud_fetch():
188185
results.extend(cursor.fetchmany(10))
189186
results.extend(cursor.fetchall())
190187
actual_row_count = len(results)
191-
logger.info(
192-
f"{actual_row_count} rows retrieved against {requested_row_count} requested"
193-
)
194188

195189
logger.info(
196190
f"Requested {requested_row_count} rows, received {actual_row_count} rows"

src/databricks/sql/result_set.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ def _convert_json_types(self, rows: List) -> List:
515515
Convert raw data rows to Row objects with named columns based on description.
516516
Also converts string values to appropriate Python types based on column metadata.
517517
"""
518+
518519
if not self.description or not rows:
519520
return rows
520521

@@ -554,6 +555,7 @@ def _create_json_table(self, rows: List) -> List[Row]:
554555
Returns:
555556
List of Row objects with named columns and converted values
556557
"""
558+
557559
if not self.description or not rows:
558560
return rows
559561

@@ -575,6 +577,7 @@ def fetchmany_json(self, size: int) -> List:
575577
Raises:
576578
ValueError: If size is negative
577579
"""
580+
578581
if size < 0:
579582
raise ValueError(f"size argument for fetchmany is {size} but must be >= 0")
580583

@@ -590,6 +593,7 @@ def fetchall_json(self) -> List:
590593
Returns:
591594
Columnar table containing all remaining rows
592595
"""
596+
593597
results = self.results.remaining_rows()
594598
self._next_row_index += len(results)
595599

@@ -609,6 +613,7 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
609613
ImportError: If PyArrow is not installed
610614
ValueError: If size is negative
611615
"""
616+
612617
if size < 0:
613618
raise ValueError(f"size argument for fetchmany is {size} but must be >= 0")
614619

@@ -625,6 +630,7 @@ def fetchall_arrow(self) -> "pyarrow.Table":
625630
"""
626631
Fetch all remaining rows as an Arrow table.
627632
"""
633+
628634
if not isinstance(self.results, JsonQueue):
629635
raise NotImplementedError("fetchall_arrow only supported for JSON data")
630636

@@ -642,6 +648,7 @@ def fetchone(self) -> Optional[Row]:
642648
Returns:
643649
A single Row object or None if no more rows are available
644650
"""
651+
645652
if isinstance(self.results, JsonQueue):
646653
res = self._create_json_table(self.fetchmany_json(1))
647654
else:
@@ -662,6 +669,7 @@ def fetchmany(self, size: int) -> List[Row]:
662669
Raises:
663670
ValueError: If size is negative
664671
"""
672+
665673
if isinstance(self.results, JsonQueue):
666674
return self._create_json_table(self.fetchmany_json(size))
667675
else:
@@ -674,6 +682,7 @@ def fetchall(self) -> List[Row]:
674682
Returns:
675683
List of Row objects containing all remaining rows
676684
"""
685+
677686
if isinstance(self.results, JsonQueue):
678687
return self._create_json_table(self.fetchall_json())
679688
else:

0 commit comments

Comments
 (0)