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

Fixed small issue with ordering of statements in extract_text #385

Merged
merged 2 commits into from
Mar 19, 2021

Conversation

alexreg
Copy link
Contributor

@alexreg alexreg commented Mar 19, 2021

chars = to_list(chars) and len(chars) need to be swapped to avoid error sometimes.

Fixes issue #386.

`chars = to_list(chars)` and `len(chars)` need to be swapped to avoid error sometimes.
@codecov
Copy link

codecov bot commented Mar 19, 2021

Codecov Report

Merging #385 (47fb9d5) into stable (3b6fee4) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 47fb9d5 differs from pull request most recent head cbfb606. Consider uploading reports for the commit cbfb606 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           stable     #385   +/-   ##
=======================================
  Coverage   98.25%   98.25%           
=======================================
  Files          10       10           
  Lines        1205     1205           
=======================================
  Hits         1184     1184           
  Misses         21       21           
Impacted Files Coverage Δ
pdfplumber/table.py 100.00% <ø> (ø)
pdfplumber/utils.py 100.00% <100.00%> (ø)

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 3b6fee4...cbfb606. Read the comment docs.

Copy link
Collaborator

@samkit-jain samkit-jain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate you opening a PR @alexreg Request you to add a test case that passes on this commit and fails otherwise.

@alexreg
Copy link
Contributor Author

alexreg commented Mar 19, 2021

@samkit-jain Sure, will do. How do I run tests though? Ideally, this should be documented in the README.

@jsvine
Copy link
Owner

jsvine commented Mar 19, 2021

Thanks, @alexreg and @samkit-jain. I really appreciate the test addition — generally ... but also specifically in this case, because it clarifies what's going on here: The previous code didn't work when the chars argument is a generator. It might be a fairly edge-case situation, but since the fix is very straightforward and doesn't affect performance, I'll merge it.

@jsvine jsvine merged commit 8dd1f88 into jsvine:stable Mar 19, 2021
@jsvine
Copy link
Owner

jsvine commented Mar 19, 2021

And, yes, @alexreg — it's definitely worth us adding PR guidelines (including re. tests). Will open an issue on that and self-assign.

@alexreg
Copy link
Contributor Author

alexreg commented Mar 19, 2021

@jsvine That was my thought too, basically. Thanks for merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants