error resolution in sas file
State: closed

- [x] closes https://github.com/pandas-dev/pandas/issues/18198
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] SAS file is now giving empty dataframe. Not NONE.


Labels:

Comments:
Hello @Pranava1709! Thanks for opening this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:

* In the file [`sas.py`](https://github.com/pandas-dev/pandas/blob/0305850505f02bd0530441881a5cee71fa36a439/sas.py):

> [Line 6:1](https://github.com/pandas-dev/pandas/blob/0305850505f02bd0530441881a5cee71fa36a439/sas.py#L6): [E265](https://duckduckgo.com/?q=pep8%20E265) block comment should start with '# '
> [Line 9:1](https://github.com/pandas-dev/pandas/blob/0305850505f02bd0530441881a5cee71fa36a439/sas.py#L9): [W391](https://duckduckgo.com/?q=pep8%20W391) blank line at end of file


hi @Pranava1709 seems like a fat finger or mistaken PR. You can't really just add random python script files that don't have any impact on the codebase.
Please re-open and re-commit if you have code change contributions to make
The python script that I have added solves one of the issues. I have also
tested it on my local computer. You can cross-check the issue.


On Tue, Aug 31, 2021 at 10:28 PM JHM Darbyshire ***@***.***>
wrote:

> hi @Pranava1709 <https://github.com/Pranava1709> seems like a fat finger
> or mistaken PR. You can't really just add random python script files that
> don't have any impact on the codebase.
> Please re-open and re-commit if you have code change contributions to make
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/43326#issuecomment-909415745>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AOP7GWZAMUQPOKF6W5QSDCTT7UC4RANCNFSM5DD5CVMQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>

This is outside of anything Pandas uses. How does that solve any issues?

edit: please read the contributing guidelines 
My code has used only one library which is pandas. The issue(#43326) was
that the SAS file with 0 rows was giving NONE, while CSV was giving an
empty data frame. With this script, SAS file is also giving empty data
frame instead of none.

On Tue, Aug 31, 2021 at 10:53 PM Patrick Hoefler ***@***.***>
wrote:

> This is outside of anything Pandas uses. How does that solve any issues?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/43326#issuecomment-909435484>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AOP7GW7MV6V3VSIGNUTULWLT7UFZDANCNFSM5DD5CVMQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>

But how does this fix the pandas function read_sas?
It does not fix read_sas. It fixes the issue that was coming in the output.
According to the issue, there is no mention that the issue is in read_sas.
I solved this issue keeping the problem in mind that it was not giving an
empty data frame with 0 rows.
So I took a file, removed the rows and checked it and got the required
output.

On Tue, Aug 31, 2021 at 11:04 PM Patrick Hoefler ***@***.***>
wrote:

> But how does this fix the pandas function read_sas?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/43326#issuecomment-909443590>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AOP7GW27APJCCYRYC5LLNLDT7UHCVANCNFSM5DD5CVMQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>

We would want read_sas to return the correct result. Everything Else does Not help out users. Please read the contributing guidelines 
It is returning. It's just I had a random dataset, in which I removed the
rows. If you pass an original file with 0 rows read_sas will give the same
output. The extra part is the preprocessing of data that's it as the file
was not empty.


On Tue, Aug 31, 2021 at 11:12 PM Patrick Hoefler ***@***.***>
wrote:

> We would want read_sas to return the correct result. Everything Else does
> Not help out users. Please read the contributing guidelines
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/43326#issuecomment-909449536>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AOP7GW6DP3U3IPPBOBW6W6TT7UH7RANCNFSM5DD5CVMQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>

Then the function already is correct, so no need to add  anything except a Test case 
This was an issue so I took it up.

On Tue, Aug 31, 2021 at 11:18 PM Patrick Hoefler ***@***.***>
wrote:

> Then the function already is correct, so no need to add anything except a
> Test case
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/43326#issuecomment-909454613>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AOP7GWZLW3SULQJUSTERHBDT7UIXRANCNFSM5DD5CVMQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>

If an issue is already fixed we add a test to close and avoid regressions.
So what do I do now? I took this issue for my internship. They wanted to
fix one of the issues and send the pull request to them.

On Tue, Aug 31, 2021 at 11:21 PM Patrick Hoefler ***@***.***>
wrote:

> If an issue is already fixed we add a test to close and avoid regressions.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/43326#issuecomment-909456842>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AOP7GWY6KK5F7LEIJF6TQFTT7UJBVANCNFSM5DD5CVMQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>

Add a test checking that an empty sas file is read as an empty dataframe.