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: Fill NAN and NAT fields before sending them to the frontend #394

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

chdecultot
Copy link
Contributor

Hi,

I encountered an issue when trying to load a CSV file, exported from Google Sheets, that contained NAT or NAN values.

Example output after been read by Ibis:

{
        "Product Code": "zzzzzz",
        "Project Code": "zzzzzz",
        "Accounting Period": NaT,
        "Doc N°": nan,
        "Order": None,
        "Contract": None,
}

In this case it doesn't throw any error in the UI, the dialog only shows No data to display.
In the console we have the following error: Error: SyntaxError: JSON.parse: unexpected character at line 1 column 1714 of the JSON data

My proposal is to apply a fillna on the first 50 rows before they are sent back to the UI, so that the JSON can be correctly read on the client side.

Please let me know if you disagree with this solution.

Have a nice day !

@nextchamp-saqib nextchamp-saqib merged commit cd84c39 into frappe:develop Dec 13, 2024
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.

2 participants