Skip to content

Commit

Permalink
Use ChunkedBase 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Drvi committed Jul 19, 2023
1 parent f80b4b1 commit 20c7625
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SentinelArrays = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"

[compat]
ChunkedBase = "0.2"
ChunkedBase = "0.3"
JSON3 = "1"
SentinelArrays = "1"
SnoopPrecompile = "1"
Expand Down
2 changes: 1 addition & 1 deletion src/ChunkedJSONL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function parse_file(

lexer = Lexer(io, nothing, newline)
ChunkedBase.initial_lex!(lexer, chunking_ctx, bytes_read_in)
ChunkedBase.skip_rows_init!(lexer, chunking_ctx, skipto)
ChunkedBase.skip_rows_init!(lexer, chunking_ctx, skipto, ignoreemptyrows)

nrows = length(chunking_ctx.newline_positions) - 1
try
Expand Down
9 changes: 7 additions & 2 deletions test/basic_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -854,12 +854,17 @@ end
ctx = ValueExtractionContext()
ChunkedJSONL.parse_file(IOBuffer("1\n2\n\n3\n4\n5"), ctx, _force=alg, buffersize=4, skipto=2, limit=2)

@test ctx.elements == [3]
@test ctx.elements == [3, 4]

ctx = ValueExtractionContext()
ChunkedJSONL.parse_file(IOBuffer("0\n1\n2\n\n3\n4\n5"), ctx, _force=alg, buffersize=4, skipto=2, limit=2)

@test ctx.elements == [2]

ctx = ValueExtractionContext()
ChunkedJSONL.parse_file(IOBuffer("1\n#\n#\n#\n2\n#\n3\n4\n5"), ctx, _force=alg, buffersize=4, skipto=2, limit=3, comment='#')

@test sort(ctx.elements) == [2,3]
@test sort(ctx.elements) == [2, 3]
end
end

Expand Down

0 comments on commit 20c7625

Please sign in to comment.