vnmabus / rdata

Reader of R datasets in .rda format, in Python
https://rdata.readthedocs.io
MIT License
40 stars 2 forks source link

reading logical vector with all NA returns a vector of all True #37

Closed r-re closed 5 months ago

r-re commented 5 months ago

Bug description summary

an R data.frame like

tmp <- data.frame(all_na = c(NA, NA)) is imported as

{'tmp': all_na
1 True
2 True
3 True}

Code to reproduce the bug

No response

Data file(s)

tmp <- data.frame(all_na = c(NA, NA, NA)) save(tmp, "na_test.RData")

Expected result

should return the equivalent of a missing value.

Actual result

{'tmp': all_na
1 True
2 True
3 True}

Traceback (if an exception is raised)

No response

Software versions

rdata version: 0.9

Additional context

No response

vnmabus commented 5 months ago

Please, check if that happens with the development version. For me, in the development version I obtain:

{'test_all_na':    all_na
1    <NA>
2    <NA>
3    <NA>}
r-re commented 5 months ago

Thanks for the quick reply and the solution. It works as you described. Thanks again!