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

csvsql Import to Mysql #1266

Open
scoleri opened this issue Oct 24, 2024 · 5 comments
Open

csvsql Import to Mysql #1266

scoleri opened this issue Oct 24, 2024 · 5 comments
Labels

Comments

@scoleri
Copy link

scoleri commented Oct 24, 2024

I've had to downgrade to 1.5.0 because with 2.0.1 i'm getting:

TypeError: conversion from NoneType to Decimal is not supported

This is when importing to mysql.

csvsql --db "mysql+mysqlconnector://admin:$PASS@$HOST:3306/blah" --table "TableBlah" --create-if-not-exists --unique-constraint ReportId,InstanceId --insert -
@jpmckinney
Copy link
Member

I’ll need the CSV data to debug.

@Gunbit
Copy link

Gunbit commented Nov 6, 2024

I have the same problem here, are the CSV data
last_sync_at,number,description,description2,unit_price,vat_group,base_unit,net_weight,remaining_quantity 2024-11-06 14:47:29.077000,1000079510,ERDUNGSKABEL 120mm lg.,(1 Verpackungseinheit = 10 Stück),21.10000000000000000000,19,PACK,0.50000000000000000000,9.00000000000000000000 2024-11-06 14:47:29.077000,1000079610,ERDUNGSKABEL 230mm lg.,(1 Verpackungseinheit = 10 Stück),26.70000000000000000000,19,PACK,0.50000000000000000000,2.00000000000000000000 2024-11-06 14:47:29.077000,1000079705,ERDUNGSKABEL 330mm lg.,(1 Verpackungseinheit = 5 Stück),26.00000000000000000000,19,PACK,0.50000000000000000000,33.00000000000000000000 2024-11-06 14:47:29.077000,1000079805,ERDUNGSKABEL 430mm lg.,(1 Verpackungseinheit = 5 Stück),28.10000000000000000000,19,PACK,0.50000000000000000000,7.00000000000000000000

@jpmckinney thx

@jpmckinney
Copy link
Member

jpmckinney commented Nov 7, 2024

I can't reproduce the issue. Please share the full command you ran, and csvkit version number as requested here https://github.com/wireservice/csvkit/blob/master/CONTRIBUTING.rst

@Gunbit
Copy link

Gunbit commented Nov 7, 2024

It's happened sometimes version was 2.0.1. It does not currently happen with 2.0.0.

You will receive further information from me

@sgpeter1
Copy link
Contributor

sgpeter1 commented Nov 7, 2024

According to the SQLAlchemy documentation:

The MySQL Connector/Python DBAPI has had many issues since its release, some of which may remain unresolved, and the mysqlconnector dialect is not tested as part of SQLAlchemy’s continuous integration. The recommended MySQL dialects are mysqlclient and PyMySQL.

I'm not sure if it'll solve your issue here, but perhaps consider using mysqlclient or PyMySQL.

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

4 participants