Skip to content

Commit

Permalink
Truncate the column name in case it's too long (2k chars)
Browse files Browse the repository at this point in the history
  • Loading branch information
whatsthecraic committed Nov 22, 2023
1 parent e7993a8 commit 1bde0d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/init_parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ function process_header_and_schema_and_finish_row_skip!(
try
push!(parsing_ctx.header, Symbol(identifier_s))
catch
throw(HeaderParsingError("Error parsing header for column $i ('$(identifier_s)') at " *
# defensively truncate identifier_s to 2k characters in case something is very cursed
throw(HeaderParsingError("Error parsing header for column $i ('$(first(identifier_s, 2000))') at " *
"$(lines_skipped_total+1):$pos (row:pos): presence of invalid non text bytes in the CSV snippet"))
end
end
Expand Down Expand Up @@ -176,7 +177,8 @@ function process_header_and_schema_and_finish_row_skip!(
try
push!(parsing_ctx.header, Symbol(identifier_s))
catch
throw(HeaderParsingError("Error parsing header for column $i ('$(identifier_s)') at " *
# defensively truncate identifier_s to 2k characters in case something is very cursed
throw(HeaderParsingError("Error parsing header for column $i ('$(first(identifier_s, 2000))') at " *
"$(lines_skipped_total+1):$pos (row:pos): presence of invalid non text bytes in the CSV snippet"))
end
end
Expand Down

0 comments on commit 1bde0d6

Please sign in to comment.