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 291 tests #294

Closed
wants to merge 1 commit into from
Closed

Fix 291 tests #294

wants to merge 1 commit into from

Conversation

fxstempfelals
Copy link
Contributor

closes #291

@WillAyd
Copy link
Collaborator

WillAyd commented Apr 22, 2024

Looks like a merge conflict - can you merge in main?

pt.frame_to_hyper(frame, tmp_hyper, table="test")
pt.frame_from_hyper(tmp_hyper, table="test")
assert not pathlib.Path("hyperd.log").is_file()
assert not (tmp_path / "hyperd.log").is_file()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think there is anything that guarantees tmp_hyper and tmp_path are the same directory, so I'm not sure this really tests anything.

When running the test suite locally I would still see some tests generating a hyperd.log (not the ones you fixed) so I think there is something else in our test suite / code base that generates this outside of the work you already did

Copy link
Contributor Author

@fxstempfelals fxstempfelals Apr 22, 2024

Choose a reason for hiding this comment

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

I used tmp_path here to change the working directory to a temporary one, so that if a hyperd.log is generated, it does not persist in the file system across other tests; conversely, if other tests generate a hyperd.log file, the assert does not fail because of the file being present before the test runs (at least, that's the idea, hopefully it works as intended). The temporary directory does not need to be the same as the one where the hyper file is created.

Indeed, every test that uses a HyperProcess without the parameter {"log_config": ""} generates a hyperd.log file. That's the case of test_reads_nullable_columns in test_reader.py, and of many others.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah...so its probably just the other tests then. Nice find - we can just update the configuration for those tests directly then right? I wish this was the default on the tableauhyperapi side...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To my knowledge, there's no way to disable it globally and the parameter must be passed every time a HyperProcess is instantiated (but I might (and hope to) be wrong). But that's right, disabling the configuration in every test should do it.

@WillAyd
Copy link
Collaborator

WillAyd commented Jul 29, 2024

Thanks for the PR but this has been superseded by https://github.com/innobi/pantab/pull/304/files

@WillAyd WillAyd closed this Jul 29, 2024
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.

Make frames_from_hyper not generate hyperd.log
2 participants