ReadStat icon indicating copy to clipboard operation
ReadStat copied to clipboard

Skip deleted observations in SAS7BDAT files

Open peiyaoli2 opened this issue 3 years ago • 10 comments

Hi, it seems like ReadStat also has a similar issue as https://github.com/pandas-dev/pandas/issues/15963, where deleted observations are still being counted in rows & being read. Here is a sample output from ReadStat on the same file as the other issue:

readstat /Users/peiyao.li/Downloads/datetime.sas7bdat
Format: SAS data file (SAS7BDAT)
Columns: 5
Rows: 5
Table name: DATETIME
Format version: 8
Text encoding: WINDOWS-1252
Byte order: little-endian
Timestamp: 08 Apr 2017 09:51

And the screenshot from the other thread is shown that there are 3 rows and 2 deleted observations.

peiyaoli2 avatar Sep 29 '22 23:09 peiyaoli2

@evanmiller can you take a look at this? Thanks!

peiyaoli2 avatar Oct 24 '22 16:10 peiyaoli2

Hi, I would need a sample file to address this issue.

evanmiller avatar Jan 15 '23 19:01 evanmiller

It looks like this code may help

https://github.com/troels/pandas/commit/b31144ac706b9386dc4ff165f69e950fb72e6aa0

evanmiller avatar Jan 16 '23 01:01 evanmiller

Hi! Here is the datetime.sas7bdat used to repro this: datetime.sas7bdat.zip

It's the same file as the https://github.com/pandas-dev/pandas/issues/15963 issue

peiyaoli2 avatar Jan 16 '23 02:01 peiyaoli2

@peiyaoli2 Thanks for the link to the file. Based on the code that I linked, it looks like skipping deleted rows will be a bit of work. I'll leave this issue open, but I'm going to change it from a "bug" to an "enhancement".

evanmiller avatar Jan 16 '23 02:01 evanmiller

@evanmiller Hi! I would like to know if there is any ETA on when this feature can be supported. Thanks!

peiyaoli2 avatar May 25 '23 17:05 peiyaoli2

@evanmiller Hi. My client is facing this issue and needs an immediate fix. So I'd also like to know if there is any ETA for this to be implemented. Thanks and regards.

ito4natsf avatar Jul 25 '23 00:07 ito4natsf

@evanmiller Hi, sorry for bothering you as I send you again, but could you provide ETA for this to be implemented?

ito4natsf avatar Oct 25 '23 02:10 ito4natsf

No ETA

evanmiller avatar Oct 25 '23 04:10 evanmiller

@evanmiller Could you please implement this enhancement, since my customer using readstat repeatedly asks me to do that?

ito4natsf avatar May 22 '24 05:05 ito4natsf