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] Writers: Store nans in StringVariable as empty strings instead of 'nan' #6670

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Dec 8, 2023

Issue

Fixes #6527.

Description of changes

The function that creates a string representation for storing values in file didn't expect that a StringVariable can be np.nan. Now it does.

Our handling of StringVariable unknowns is a mess; the Table widget will apparently sometimes show nan. This must be solved in general. The present PR only fixes the crash in saving of Excel files.

Includes
  • Code changes
  • Tests

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Merging #6670 (047400d) into master (ef3465d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6670   +/-   ##
=======================================
  Coverage   88.10%   88.11%           
=======================================
  Files         321      321           
  Lines       69950    69951    +1     
=======================================
+ Hits        61631    61634    +3     
+ Misses       8319     8317    -2     

@markotoplak
Copy link
Member

I think this should be made specific to CSV writer. Any reason you did not make it that way?

Tab writers work well as they are and this fix would there only introduce new ambiguities.

@markotoplak
Copy link
Member

Ignore the previous comment. I need to check what did it do in write/read combination. If the old .tab behavior was already broken, I have no objections.

@markotoplak
Copy link
Member

Our tab saving was also broken, because it saved a string nan in such cases. Therefore, merging.

@markotoplak markotoplak changed the title Writers: Store nans in StringVariable as empty strings instead of 'nan' [ENH] Writers: Store nans in StringVariable as empty strings instead of 'nan' Dec 22, 2023
@markotoplak markotoplak changed the title [ENH] Writers: Store nans in StringVariable as empty strings instead of 'nan' [FIX] Writers: Store nans in StringVariable as empty strings instead of 'nan' Dec 22, 2023
@markotoplak markotoplak merged commit ef3f598 into biolab:master Dec 22, 2023
22 of 27 checks passed
stuart-cls added a commit to stuart-cls/orange3 that referenced this pull request Mar 7, 2024
In fixing this, switched string handling from fixed-length to variable length
https://docs.h5py.org/en/stable/special.html#variable-length-strings
stuart-cls added a commit to stuart-cls/orange3 that referenced this pull request Apr 25, 2024
In fixing this, switched string handling from fixed-length to variable length
https://docs.h5py.org/en/stable/special.html#variable-length-strings
stuart-cls added a commit to stuart-cls/orange3 that referenced this pull request Sep 27, 2024
In fixing this, switched string handling from fixed-length to variable length
https://docs.h5py.org/en/stable/special.html#variable-length-strings
stuart-cls added a commit to stuart-cls/orange3 that referenced this pull request Nov 5, 2024
In fixing this, switched string handling from fixed-length to variable length
https://docs.h5py.org/en/stable/special.html#variable-length-strings
stuart-cls added a commit to stuart-cls/orange3 that referenced this pull request Nov 5, 2024
In fixing this, switched string handling from fixed-length to variable length
https://docs.h5py.org/en/stable/special.html#variable-length-strings
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.

Save Data widget - can not same Excel files when unknows are present
2 participants