Skip to content

Commit e05ba60

Browse files
fix: appease linter
1 parent 3171478 commit e05ba60

File tree

2 files changed

+4
-40
lines changed

2 files changed

+4
-40
lines changed

lua/duckdb/health.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ local function test_csv_parsing()
110110
return false
111111
end
112112

113-
local conn, err = query_module.create_connection()
113+
local conn = query_module.create_connection()
114114
if not conn then
115115
health.warn('Cannot test CSV parsing: connection failed')
116116
return false
@@ -142,7 +142,7 @@ local function test_json_parsing()
142142
return false
143143
end
144144

145-
local conn, err = query_module.create_connection()
145+
local conn = query_module.create_connection()
146146
if not conn then
147147
health.warn('Cannot test JSON parsing: connection failed')
148148
return false

lua/duckdb/validate.lua

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ local function find_csv_column_position(line, column_num)
4141
return 0
4242
end
4343

44-
local pos = 0
4544
local col_count = 1
4645
local in_quotes = false
4746

@@ -55,7 +54,6 @@ local function find_csv_column_position(line, column_num)
5554
return i -- Position after the comma
5655
end
5756
end
58-
pos = i
5957
end
6058

6159
return 0
@@ -92,9 +90,9 @@ local function try_parse_csv_with_rejects(file_path)
9290
]], escaped_path)
9391

9492
-- Execute the read (this populates reject tables even if it succeeds)
95-
local _, query_err = query_module.execute_query(conn, read_query)
93+
local _ = query_module.execute_query(conn, read_query)
9694

97-
-- Query errors is expected if CSV is malformed - we continue to check reject tables
95+
-- Query errors are expected if CSV is malformed - we continue to check reject tables
9896

9997
-- Query reject_errors table for detailed error information
10098
local reject_result = query_module.execute_query(conn, [[
@@ -203,40 +201,6 @@ end
203201
-- JSON Validation
204202
-- ============================================================================
205203

206-
---Parse DuckDB error message to extract line/column information
207-
---@param error_msg string Error message from DuckDB
208-
---@return table<ValidationError> errors
209-
local function parse_duckdb_error(error_msg)
210-
local errors = {}
211-
212-
local line_num = nil
213-
local col_num = nil
214-
215-
-- Try to extract line/column numbers from error message
216-
line_num = error_msg:match("line (%d+)") or error_msg:match("Line: (%d+)")
217-
col_num = error_msg:match("column (%d+)") or error_msg:match("position (%d+)")
218-
219-
-- Determine error type based on message content
220-
local error_type = "parse"
221-
if error_msg:match("[Tt]ype") or error_msg:match("[Cc]onversion") then
222-
error_type = "type"
223-
elseif error_msg:match("[Ss]chema") or error_msg:match("[Cc]olumn") then
224-
error_type = "schema"
225-
elseif error_msg:match("JSON") or error_msg:match("json") then
226-
error_type = "json"
227-
end
228-
229-
table.insert(errors, {
230-
line = line_num and tonumber(line_num) or nil,
231-
column = col_num and tonumber(col_num) or nil,
232-
message = error_msg,
233-
severity = "error",
234-
error_type = error_type,
235-
})
236-
237-
return errors
238-
end
239-
240204
---Validate JSON content
241205
---@param content string JSON content
242206
---@return ValidationResult result

0 commit comments

Comments
 (0)