Skip to content

Commit f126f4b

Browse files
remove redundant method
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 12a5ff8 commit f126f4b

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

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

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,6 @@ def _create_filtered_result_set(
111111
arraysize=result_set.arraysize,
112112
)
113113

114-
@staticmethod
115-
def _validate_column_index(result_set: SeaResultSet, column_index: int) -> str:
116-
"""
117-
Validate column index and return the column name.
118-
119-
Args:
120-
result_set: Result set to validate against
121-
column_index: Index of the column to validate
122-
123-
Returns:
124-
str: Column name at the specified index
125-
126-
Raises:
127-
ValueError: If column index is out of bounds
128-
"""
129-
if column_index >= len(result_set.description):
130-
raise ValueError(f"Column index {column_index} is out of bounds")
131-
return result_set.description[column_index][0]
132-
133114
@staticmethod
134115
def _filter_arrow_table(
135116
table: Any, # pyarrow.Table
@@ -192,7 +173,9 @@ def _filter_arrow_result_set(
192173
A filtered SEA result set
193174
"""
194175
# Validate column index and get column name
195-
column_name = ResultSetFilter._validate_column_index(result_set, column_index)
176+
if column_index >= len(result_set.description):
177+
raise ValueError(f"Column index {column_index} is out of bounds")
178+
column_name = result_set.description[column_index][0]
196179

197180
# Get all remaining rows as Arrow table and filter it
198181
arrow_table = result_set.results.remaining_rows()

0 commit comments

Comments
 (0)