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

Add tests for import/export with pandas DataFrames #142

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

Nicoretti
Copy link
Member

  • Add pandas test marker
  • Add basic test for pandas import and export

expected = pd.DataFrame.from_records(values)
actual = connection.export_to_pandas(table_name)

assert actual.equals(expected)
Copy link

Choose a reason for hiding this comment

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

Maybe it's better to use the pandas.testing.assert_frame_equal. Then you will have more options. For example you can disregard the row order, which might be useful.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @ahsimb,

Good point, I must admit I had it in before but for me this version seemed to be simpler to use 😅 likely because I am not so familiar with pandas and it wasn't immediately obvious which settings to use, because the default did not seem to be sufficient in my case.

], columns=["USER_NAME", "USER_ID"])
actual = connection.export_to_pandas(query)

assert actual.equals(expected)
Copy link

Choose a reason for hiding this comment

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

Same as before.

Copy link
Member Author

Choose a reason for hiding this comment

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

same as above

@Nicoretti Nicoretti merged commit 4591bcf into master Jun 25, 2024
10 checks passed
@Nicoretti Nicoretti deleted the test/add-tests-for-pandas branch June 25, 2024 12:30
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