Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve parse_lines error message. #3569

Merged
merged 1 commit into from
Jun 4, 2022

Conversation

ghuls
Copy link
Collaborator

@ghuls ghuls commented Jun 3, 2022

Improve parse_lines error message:

  • Fix file offset at which the error was encountered
    (header and skipped lines were not included).
  • Remove leading spaces in error message due to use
    of raw string.
  • Add other ideas (specify correct dtype or increasing
    number of records used to infer the schema) to
    potentionaly avoid the error, as the error also show
    up quite frequently when an incorrect dtype was
    inferred.

Previous error message:

ComputeError: Could not parse 3.0 as dtype Int64 at column 3.
The total offset in the file is 37 bytes.

                                        Consider running the parser `with_ignore_parser_errors=true`
                                        or consider adding 3.0 to the `null_values` list.

Current error message:

ComputeError: Could not parse 3.0 as dtype Int64 at column 3.
The current offset in the file is 69 bytes.

Consider specifying the correct dtype, increasing
the number of records used to infer the schema,
running the parser with ignore_parser_errors=true
or adding 3.0 to the null_values list.

Improve parse_lines error message:
  - Fix file offset at which the error was encountered
    (header and skipped lines were not included).
  - Remove leading spaces in error message due to use
    of raw string.
  - Add other ideas (specify correct dtype or increasing
    number of records used to infer the schema) to
    potentionaly avoid the error, as the error also show
    up quite frequently when an incorrect dtype was
    inferred.

Previous error message:

ComputeError: Could not parse 3.0 as dtype Int64 at column 3.
                                            The total offset in the file is 37 bytes.

                                            Consider running the parser `with_ignore_parser_errors=true`
                                            or consider adding 3.0 to the `null_values` list.

Current error message:

ComputeError: Could not parse `3.0` as dtype Int64 at column 3.
The current offset in the file is 69 bytes.

Consider specifying the correct dtype, increasing
the number of records used to infer the schema,
running the parser with `ignore_parser_errors=true`
or  adding `3.0` to the `null_values` list.
@github-actions github-actions bot added the rust Related to Rust Polars label Jun 3, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #3569 (60b56c8) into master (322f1ed) will decrease coverage by 16.06%.
The diff coverage is 61.11%.

@@             Coverage Diff             @@
##           master    #3569       +/-   ##
===========================================
- Coverage   77.62%   61.56%   -16.07%     
===========================================
  Files         425      424        -1     
  Lines       71364    71065      -299     
===========================================
- Hits        55396    43749    -11647     
- Misses      15968    27316    +11348     
Impacted Files Coverage Δ
polars/polars-io/src/csv_core/parser.rs 81.10% <0.00%> (-5.18%) ⬇️
polars/polars-io/src/csv_core/csv.rs 79.09% <100.00%> (-1.82%) ⬇️
polars/polars-io/src/tests.rs 0.00% <0.00%> (-100.00%) ⬇️
polars/polars-time/src/lib.rs 0.00% <0.00%> (-100.00%) ⬇️
polars/polars-arrow/src/lib.rs 0.00% <0.00%> (-100.00%) ⬇️
polars/polars-utils/src/lib.rs 0.00% <0.00%> (-100.00%) ⬇️
polars/polars-core/src/tests.rs 0.00% <0.00%> (-100.00%) ⬇️
polars/polars-io/src/prelude.rs 0.00% <0.00%> (-100.00%) ⬇️
polars/polars-arrow/src/error.rs 0.00% <0.00%> (-100.00%) ⬇️
polars/polars-time/src/windows/test.rs 0.00% <0.00%> (-100.00%) ⬇️
... and 205 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 322f1ed...60b56c8. Read the comment docs.

@ritchie46 ritchie46 merged commit a3a7fdf into pola-rs:master Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants