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

error_bad_lines argument has been deprecated #88

Open
frafra opened this issue May 26, 2022 · 11 comments · May be fixed by #92
Open

error_bad_lines argument has been deprecated #88

frafra opened this issue May 26, 2022 · 11 comments · May be fixed by #92

Comments

@frafra
Copy link

frafra commented May 26, 2022

I get a deprecation warning on the latest stable.

csvs_to_sqlite/utils.py:38: FutureWarning: The error_bad_lines argument has been deprecated and will be removed in a future version. Use on_bad_lines in the future.
@LuighiV
Copy link

LuighiV commented Apr 6, 2023

Hi,
This is giving an error now:

Could not load file.csv: read_csv() got an unexpected keyword argument 'error_bad_lines'

It would be great if it can be updated.

@LuighiV
Copy link

LuighiV commented Apr 6, 2023

From the pandas release notes for the latest version (April, 3 2023)

Removed arguments prefix, squeeze, error_bad_lines and warn_bad_lines from read_csv() (GH40413, GH43427)

https://pandas.pydata.org/docs/whatsnew/v2.0.0.html#removal-of-prior-version-deprecations-changes

@ross-spencer
Copy link

Seeing this error in 1.3 now. A workaround is to temporarily roll back pandas: pip install 'pandas==1.4.0'

@ribtoks
Copy link

ribtoks commented Jun 22, 2023

Also having this issue. Crazy that it's almost a year now! Maybe nobody is using csvs-to-sqlite?

@virtadpt
Copy link

Yep, that did it.

@rtanglao
Copy link

this worked for me too!

pip3 install 'pandas==1.4.0'
# git clone from this repo and cd to that directory
pip3 install -e .

stefankuehnel added a commit to bystefankuehnel/naruto.dvd.stefan-dev.de that referenced this issue Nov 2, 2023
Using 'csvs-to-sqlite' leads to the following error

  Could not load collection.csv: read_csv() got an unexpected keyword argument 'error_bad_lines'

This is because 'error_bad_lines' is replaced by 'on_bad_lines' in a
newer version of Pandas [1].

However, the bug report in 'csvs-to-sqlite' is still open [2].
Therefore, use the newer and more maintained 'sqlite-utils' instead.

Link: https://stackoverflow.com/a/76503893 [1]
Link: simonw/csvs-to-sqlite#88 [2]

Signed-off-by: Stefan Kühnel <[email protected]>
@panique
Copy link

panique commented Dec 8, 2023

Also having this issue. Crazy that it's almost a year now! Maybe nobody is using csvs-to-sqlite?

Asked myself the same, but the tool has hundreds of downloads each WEEK! Looks like lots of people try it out and then give up as it doesnt work out of the box.

@virtadpt
Copy link

virtadpt commented Dec 8, 2023

@panique Or we're just using it every day and don't see a need to mention it. It's just another tool in the toolbox, like awk or vi.

@BryantD
Copy link

BryantD commented Dec 20, 2023

If you've been using it all along and you haven't updated pandas, you won't see the issue -- this is a problem that occurs if you do a fresh install.

I'm working around it by just using sqlite-utils:

sqlite-utils insert reviews.db reviews reviews.csv --csv

is functionally identical to:

csvs-to-sqlite reviews.csv reviews.db

#69 seems relevant here.

@bwingen1
Copy link

If anyone's struggling with csvs-to-sqlite, this set of requirements works:
pip>=24.2
csvs-to-sqlite
datasette
numpy==1.23.2
pandas==1.4.4

(Did this with py 3.9.6)

@Esonhugh
Copy link

Esonhugh commented Aug 2, 2024

If anyone's struggling with csvs-to-sqlite, this set of requirements works: pip>=24.2 csvs-to-sqlite datasette numpy==1.23.2 pandas==1.4.4

(Did this with py 3.9.6)

pipx user fixer

pipx inject csvs-to-sqlite pandas==1.4.4 --force
pipx inject csvs-to-sqlite numpy==1.23.2 --force

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 a pull request may close this issue.

10 participants