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

TypeError: PageImage.debug_tablefinder() got an unexpected keyword argument 'table_settings' #1237

Closed
n-traore opened this issue Dec 19, 2024 · 3 comments
Labels

Comments

@n-traore
Copy link

n-traore commented Dec 19, 2024

Describe the bug

I am trying to debug a table extraction as shown in the docs (here), and I am getting a type error on the debug_tablefinder() method:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[16], line 1
----> 1 img.debug_tablefinder(table_settings={})

TypeError: PageImage.debug_tablefinder() got an unexpected keyword argument 'table_settings'

Code to reproduce the problem

import pdfplumber

pdf = pdfplumber.open("report.pdf")
page2 = pdf.pages[1]
img = page2.to_image()
img.debug_tablefinder(table_settings={})

PDF file

Not relevant, the issue is the same with any pdf file.

Expected behavior

The method should work and return an image

Actual behavior

An error is thrown.

Screenshots

image

Environment

  • pdfplumber version: [0.11.4 and 0.11.3]
  • Python version: [3.10.11]
  • OS: [Windows]
@n-traore n-traore added the bug label Dec 19, 2024
@n-traore
Copy link
Author

n-traore commented Dec 19, 2024

Closing this as it appears to work with passing the dictionary only (without keyword table_settings), but this should be reflected in the docs, especially since the keyword argument works for page.debug_tablefinder(). This is confusing.

@cmdlineluser
Copy link

cmdlineluser commented Dec 20, 2024

You should probably keep the issue is open so that it can get fixed.

It seems the kwarg for debug_tablefinder is tf= for some reason.

@n-traore n-traore reopened this Dec 20, 2024
jsvine added a commit that referenced this issue Dec 31, 2024
@jsvine
Copy link
Owner

jsvine commented Dec 31, 2024

Thank you @n-traore and @cmdlineluser — now fixed in commit above and on develop.

@jsvine jsvine closed this as completed Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants