Skip to content

Conversation

@ueshin
Copy link
Collaborator

@ueshin ueshin commented Mar 11, 2021

Checks explicitly index_dtype and data_dtypes are the instance of np.dtype or ExtensionDtype.

@ueshin ueshin marked this pull request as ready for review March 11, 2021 03:43
@ueshin ueshin changed the title Check index_dtype and data_dtypes more strict. Check index_dtype and data_dtypes more strictly. Mar 12, 2021

assert all(
as_spark_type(dtype, raise_error=False) is not None for dtype in data_dtypes
isinstance(dtype, Dtype.__args__) # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Can I take it as pandas dtype consists of np.dtype and ExtensionDtype?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks!

@xinrong-meng
Copy link
Contributor

Looks great, thank you!

@ueshin
Copy link
Collaborator Author

ueshin commented Mar 16, 2021

Thanks! merging.

@ueshin ueshin merged commit e38ac6d into databricks:master Mar 16, 2021
@ueshin ueshin deleted the dtypes branch March 16, 2021 00:23
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