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

Remove unused functions + prevent error reading sqlite db #110

Merged
merged 5 commits into from
Oct 5, 2022

Conversation

geoffreyaldebert
Copy link
Contributor

@geoffreyaldebert geoffreyaldebert commented Sep 19, 2022

This PR prevent errors when csv-detective does not detect well types of csv file.

Finally, it is agate which is responsible for choosing the type by inserting the data into sqlite. The pandas read_sql_query function can read sqlite types, so no need to tell it to force parsing (maybe wrong) types.

Copy link
Contributor

@abulte abulte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay for less code 💪 😉

csvapi/parser.py Outdated
Comment on lines 42 to 43
except Exception as e:
app.logger.error('error casting %s', e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
except Exception as e:
app.logger.error('error casting %s', e)

This except was supposed to be a fallback for a CastError and we don't handle this case anymore. I think we can let the generic exception bubble up as before.

@geoffreyaldebert geoffreyaldebert merged commit be64fa4 into master Oct 5, 2022
@geoffreyaldebert geoffreyaldebert deleted the clean-types-detection branch October 5, 2022 14:39
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

Successfully merging this pull request may close these issues.

3 participants