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

CI: avoid file leaks in sas_xport tests #35693

Merged
merged 8 commits into from
Aug 13, 2020

Conversation

jbrockmendel
Copy link
Member

Introduces a contextmanager version of td.check_file_leaks so we can do more targeted versions of those checks for debugging

@@ -127,7 +131,8 @@ def test2_binary(self):
data_csv = pd.read_csv(self.file02.replace(".xpt", ".csv"))
numeric_as_float(data_csv)

data = read_sas(self.file02b, format="xport")
with open(self.file02, "rb") as fd:
data = read_sas(fd, format="xport")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this actually leaking?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC ATM we're passing an open file and the read_sas call closes it incorrectly, so its an anti-leak

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't make sense; there is a bug in the xport reader; paper it over here is not a great soln.

@jreback jreback added the IO SAS SAS: read_sas label Aug 13, 2020
@jreback jreback added this to the 1.2 milestone Aug 13, 2020
@jreback jreback merged commit ed23eb8 into pandas-dev:master Aug 13, 2020
@jreback
Copy link
Contributor

jreback commented Aug 13, 2020

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO SAS SAS: read_sas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants