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

Check index_dtype and data_dtypes more strictly. #2100

Merged
merged 2 commits into from
Mar 16, 2021

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
else dtype
for dtype, scol in zip(data_dtypes, data_spark_columns)
]

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