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

Handle NaN values in String columns correctly #11

Merged
merged 1 commit into from
Feb 8, 2024
Merged

Conversation

DavidStirling
Copy link
Member

It turns out that by default Pandas reads missing values in .csv files as float NaN objects. For our column generator this had some consequences:

  • Max length for string columns was returned as a float rather than an integer, which is invalid as an OMERO column descriptor. I've added a cast to make sure that 14.0 is handled correctly.
  • NaN values mixed with strings would be rejected during the upload process. When building String columns for upload we'll now convert these into empty strings.

@emilroz
Copy link
Member

emilroz commented Feb 8, 2024

Looks good to me. Went from:

ValueError: invalid value for element 4 of sequence<string>

to

2024-02-08 15:29:07,395 INFO    [omero2pandas.upload] Table creation complete, linking to image

@emilroz emilroz merged commit 27bbe10 into main Feb 8, 2024
12 checks passed
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