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

Reverting numpy 1.21.2 to 1.19.2 and adding regression #300

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

NikhilRaverkar
Copy link
Contributor

@NikhilRaverkar NikhilRaverkar commented Jul 14, 2022

Issue #, if available:

Description of changes:

  • Numpy 1.2.x broke the integration with Pyarrow 1.0. Rolling back numpy version to 1.19.2
  • Added regression test

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines 257 to 262
def test_pyarrow_to_parquet_conversion_does_not_throw_exception(self):
try:
df = pd.DataFrame({'x': [1,2]})
df.to_parquet('test.parquet', engine='pyarrow')
except Exception as e:
assert False, "conversion to parquet should not fail"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def test_pyarrow_to_parquet_conversion_does_not_throw_exception(self):
try:
df = pd.DataFrame({'x': [1,2]})
df.to_parquet('test.parquet', engine='pyarrow')
except Exception as e:
assert False, "conversion to parquet should not fail"
def test_pyarrow_to_parquet_conversion_regression_issue_106(self):
df = pd.DataFrame({'x': [1,2]})
df.to_parquet('test.parquet', engine='pyarrow')

We don't want the exception to be swallowed if it does fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to add an assertion, you check check that the values are equivalent before and after conversion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the exception it will fail the test, thus will fail the build as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but surfacing the actual exception will make the failure obvious and debugging easier instead of swallowing it with a generic "assert False".

@NikhilRaverkar NikhilRaverkar marked this pull request as ready for review July 14, 2022 21:14
@NikhilRaverkar NikhilRaverkar requested a review from mabunday July 14, 2022 22:18
@NikhilRaverkar NikhilRaverkar changed the title Issue 106 Reverting numpy 1.21.2 to 1.19.2 and adding regression Jul 14, 2022
@NikhilRaverkar NikhilRaverkar merged commit c9fa83d into master Jul 15, 2022
@mabunday mabunday deleted the issue_106 branch August 4, 2022 20:33
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.

2 participants