Replies: 1 comment
-
O ideal seria você passar cópia do console a partir do comando que vc rodou. Como o script começou a rodar e deve ter carregado algumas tabelas, talvez seja um problema na instalação da biblioteca dask. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Boa noite, ao executar o script dados_cnpj_para_sqlite.py, ocorre ao carregar a tabela EMPRECSV, o seguinte erro:
(...)
carregando: arq='G:\CNPJ\dados-publicos\K3241.K03200Y0.D41109.EMPRECSV' em empresas
lendo csv ... Tue Dec 3 20:58:16 2024
C:\ProgramData\anaconda3\lib\site-packages\dask\dataframe\io\sql.py:423: UserWarning: pandas only supports SQLAlchemy connectable (engine/connection) or database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 objects are not tested. Please consider using SQLAlchemy.
q = d.to_sql(con=engine, **kwargs)
Traceback (most recent call last):
File "C:\Python\cnpj-sqlite-main\dados_cnpj_para_sqlite.py", line 160, in
carregaTipo('empresas', '.EMPRECSV', colunas_empresas)
File "C:\Python\cnpj-sqlite-main\dados_cnpj_para_sqlite.py", line 154, in carregaTipo
ddf.to_sql(nome_tabela, engine_url, index=None, if_exists='append', dtype=sqlalchemy.sql.sqltypes.TEXT)
File "C:\ProgramData\anaconda3\lib\site-packages\dask_expr_collection.py", line 2430, in to_sql
return to_sql(
File "C:\ProgramData\anaconda3\lib\site-packages\dask_expr\io\sql.py", line 356, in to_sql
return _to_sql(
File "C:\ProgramData\anaconda3\lib\site-packages\dask\dataframe\io\sql.py", line 606, in to_sql
dask_compute(result)
File "C:\ProgramData\anaconda3\lib\site-packages\dask\base.py", line 660, in compute
results = schedule(dsk, keys, **kwargs)
File "C:\ProgramData\anaconda3\lib\site-packages\dask\dataframe\io\sql.py", line 423, in _to_sql_chunk
q = d.to_sql(con=engine, **kwargs)
File "C:\ProgramData\anaconda3\lib\site-packages\pandas\util_decorators.py", line 333, in wrapper
return func(*args, **kwargs)
File "C:\ProgramData\anaconda3\lib\site-packages\pandas\io\sql.py", line 842, in to_sql
return pandas_sql.to_sql(
File "C:\ProgramData\anaconda3\lib\site-packages\pandas\io\sql.py", line 2839, in to_sql
raise ValueError(f"{col} ({my_type}) not a string")
ValueError: cnpj_basico (<class 'sqlalchemy.sql.sqltypes.TEXT'>) not a string
Desde já agradeço se puder indicar uma solução. Obrigado!
Beta Was this translation helpful? Give feedback.
All reactions