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

Gettings this in every csv try - got an unexpected keyword argument 'error_bad_lines' #99

Open
Greatz08 opened this issue Jan 26, 2024 · 4 comments

Comments

@Greatz08
Copy link

20240126_14h44m29s_grim

@neiltron
Copy link

The fix seems to be to rollback pandas to a previous version. This thread mentions pinning to 1.4.0.

@segv
Copy link

segv commented Feb 28, 2024

I fixed this error locally but then hit another pandas-api-has-changed error:

Traceback (most recent call last):
  File ".../.pyenv/versions/zen312/bin/csvs-to-sqlite", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File ".../.pyenv/versions/3.12.2/envs/zen312/lib/python3.12/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.pyenv/versions/3.12.2/envs/zen312/lib/python3.12/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File ".../.pyenv/versions/3.12.2/envs/zen312/lib/python3.12/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.pyenv/versions/3.12.2/envs/zen312/lib/python3.12/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../csvs-to-sqlite/csvs_to_sqlite/cli.py", line 253, in cli
    to_sql_with_foreign_keys(
  File "/home/mb/z/datasets/csvs-to-sqlite/csvs_to_sqlite/utils.py", line 357, in to_sql_with_foreign_keys
    create_sql, columns = get_create_table_sql(
                          ^^^^^^^^^^^^^^^^^^^^^
  File ".../csvs-to-sqlite/csvs_to_sqlite/utils.py", line 314, in get_create_table_sql
    columns_and_types = df.dtypes.iteritems()
                        ^^^^^^^^^^^^^^^^^^^
  File ".../.pyenv/versions/3.12.2/envs/zen312/lib/python3.12/site-packages/pandas/core/generic.py", line 6296, in __getattr__
    return object.__getattribute__(self, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The datasette intro and getting started docs suggest using csvs-to-sqlite via pip install csvs-to-sqlite, which doesn't work if being run in a clean virtualenv (since latests pandas doesn't work with latest csvs-to-sqlite and the docs don't say to pin pandas).

I'm more than happy to have a try at making csvs-to-sqlite support both old and new pandas (how hard can it be :) ) but is there a plan to move away from old pandas or is the idea to stick with 1.4?

@kshychko
Copy link

kshychko commented Dec 12, 2024

Just in case - python 3.9 and pinning pandas and numpy versions pin helped:

pip install csvs-to-sqlite pandas==1.4.0 numpy==1.26.4

@medul6
Copy link

medul6 commented Dec 19, 2024

@kshychko thanks, that worked, but I had to specify python 3.10

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

No branches or pull requests

5 participants