Right now I have a challenge where I have to upload a CSV file into SQL but before I have to check if data is ok, and other stuff with Python. But watching by my own hand there are some rows that are wrong, so...
QUESTION:
How do you deal with, again, "wrong rows", but also well written and respecting the syntax of the SQL table? See this for example:
This is the CSV:
Jonathan; (empty, but is valid)
Nancy; She is a student in the MIT
Juan; Juan is a software developer in –
"Oracle since five years ago""; (also empty and valid, and yes it does have two "" at the end)
Gisselle; she works in Microsoft since last year etc...
And this is how it is persisted:
id (auto generated) name (varchar, not null) description (optional)
1 Juan Juan is a software developer in
2 Oracle since five years ago null
See? That part of the "Oracle since five years ago" is a continuation of Juan description which for some reason was in another row, but this technically for SQL is okay, but, as you can imagine, is not useful and totally wrong.
In this type of cases, you have to delete (or fix) the row by you own hand (or writing an specific code for that specific CSV)? There isn't any test or something than you can write in code for at least detect this issues or similar? And not only for Python, but with any other tool where you can do ETL work?