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

command fails if the filename has a square brackets #96

Open
fgregg opened this issue Nov 13, 2023 · 0 comments
Open

command fails if the filename has a square brackets #96

fgregg opened this issue Nov 13, 2023 · 0 comments

Comments

@fgregg
Copy link

fgregg commented Nov 13, 2023

> echo "a,b" > [minimal_example].csv
> csvs-to-sqlite "[minimal_example].csv" out.db
/opt/homebrew/lib/python3.10/site-packages/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.


  return pd.read_csv(
Loaded 1 dataframes
/opt/homebrew/lib/python3.10/site-packages/csvs_to_sqlite/utils.py:287: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
  columns_and_types = df.dtypes.iteritems()
Traceback (most recent call last):
  File "/opt/homebrew/bin/csvs-to-sqlite", line 8, in <module>
    sys.exit(cli())
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/csvs_to_sqlite/cli.py", line 253, in cli
    to_sql_with_foreign_keys(
  File "/opt/homebrew/lib/python3.10/site-packages/csvs_to_sqlite/utils.py", line 330, in to_sql_with_foreign_keys
    create_sql, columns = get_create_table_sql(
  File "/opt/homebrew/lib/python3.10/site-packages/csvs_to_sqlite/utils.py", line 310, in get_create_table_sql
    row[1] for row in conn.execute("PRAGMA table_info([{}])".format(table_name))
sqlite3.OperationalError: unrecognized token: "]"
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

1 participant