Skip to content

Conversation

@ueshin
Copy link
Collaborator

@ueshin ueshin commented Aug 22, 2020

Changes the testing infrastructure for exact cases to pandas' testing library.

@itholic
Copy link
Contributor

itholic commented Aug 23, 2020

Nice work! I'll revisit here after draft is finished

@ueshin ueshin marked this pull request as ready for review August 25, 2020 23:41
@ueshin ueshin requested review from HyukjinKwon and itholic August 25, 2020 23:41
@HyukjinKwon
Copy link
Member

cc @itholic can you review this?

self.assert_eq(
ks.get_dummies(kser, drop_first=True),
pd.get_dummies(pser, drop_first=True),
pd.get_dummies(pser, drop_first=True, dtype=np.int8),
Copy link
Contributor

Choose a reason for hiding this comment

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

May we don't need dtype=np.int8 here if we still use almost=True below ?

self.assert_eq(
ks.get_dummies(kser, dummy_na=True), pd.get_dummies(pser, dummy_na=True), almost=True
ks.get_dummies(kser, dummy_na=True),
pd.get_dummies(pser, dummy_na=True, dtype=np.int8),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto ?

Copy link
Contributor

@itholic itholic left a comment

Choose a reason for hiding this comment

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

Or it would be okay to leave it as it is, considering fixing it later.

kdf = ks.from_pandas(pdf)

self.assert_eq(ks.get_dummies(kdf), pd.get_dummies(pdf), almost=True)
self.assert_eq(ks.get_dummies(kdf), pd.get_dummies(pdf, dtype=np.int8), almost=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Those all same.. maybe

self.assert_eq(
ks.get_dummies(kdf, columns=[("y", "c", "3"), ("x", "a", "1")]),
pd.get_dummies(pdf, columns=[("y", "c", "3"), ("x", "a", "1")]),
pd.get_dummies(pdf, columns=[("y", "c", "3"), ("x", "a", "1")], dtype=np.int8),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

self.assert_eq(
ks.get_dummies(kdf, columns=["x"]), pd.get_dummies(pdf, columns=["x"]), almost=True
ks.get_dummies(kdf, columns=["x"]),
pd.get_dummies(pdf, columns=["x"], dtype=np.int8),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

self.assert_eq(
ks.get_dummies(kdf, columns=("x", "a")),
pd.get_dummies(pdf, columns=("x", "a")),
pd.get_dummies(pdf, columns=("x", "a"), dtype=np.int8),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

self.assert_eq(
ks.get_dummies(kdf, columns=["x"]), pd.get_dummies(pdf, columns=["x"]), almost=True
ks.get_dummies(kdf, columns=["x"]),
pd.get_dummies(pdf, columns=["x"], dtype=np.int8),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@itholic
Copy link
Contributor

itholic commented Aug 26, 2020

Otherwise, LGTM !

@ueshin
Copy link
Collaborator Author

ueshin commented Aug 26, 2020

For the dtype stuff, I'd leave them as-is for now since we will have to fix them.

@ueshin
Copy link
Collaborator Author

ueshin commented Aug 26, 2020

Thanks! I'd merge this now. Please feel free to leave comments if any.

@ueshin ueshin merged commit da686ee into databricks:master Aug 26, 2020
@ueshin ueshin deleted the testing branch August 26, 2020 18:25
ryantqiu pushed a commit to snorkel-marlin-repos/databricks_koalas_pr_1722_b82f507e-971c-4a9f-90c7-3ddce977c5bb that referenced this pull request Oct 1, 2025
ryantqiu added a commit to snorkel-marlin-repos/databricks_koalas_pr_1722_b82f507e-971c-4a9f-90c7-3ddce977c5bb that referenced this pull request Oct 1, 2025
ryantqiu pushed a commit to snorkel-marlin-repos/databricks_koalas_pr_1722_c0a015ec-4f22-4f4a-88eb-c818bb5ff630 that referenced this pull request Oct 2, 2025
ryantqiu added a commit to snorkel-marlin-repos/databricks_koalas_pr_1722_c0a015ec-4f22-4f4a-88eb-c818bb5ff630 that referenced this pull request Oct 2, 2025
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.

3 participants