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

Fix: Ensure that Pandas does not treat "None" as NaN #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jacobwegner
Copy link
Contributor

Refs scaife-viewer/beyond-translation-site@d4efc2a.

The issue was that some English texts had the word None, which Pandas 2 casts to its NaN value. Then, when we generate SQL statements from Pandas, Pandas tries to insert null values.

Read https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html and found keep_default_na; seemed to work, so if we test that, we can use Pandas 2 instead of 1.

@jacobwegner
Copy link
Contributor Author

@jtauber I think this change is backwards compatible with Pandas 1.x, but I have not done a lot of testing.

I did test this out with Python 3.12 and Pandas 1.5.3 and Pandas 2.2.0 as part of writing up scaife-viewer/beyond-translation-site#196

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.

1 participant