Skip to content

ENH Adds column name validation to pandas implementation #58

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

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

thomasjpfan
Copy link
Contributor

This PR adds column name validation into the pandas implementation to check the item 3 in Concepts in this design:

A data frame is an ordered collection of columns , which are identified with names that are unique strings.

@@ -66,6 +66,10 @@ def _from_dataframe(df : DataFrameObject) -> pd.DataFrame:
_k = _DtypeKind
_buffers = [] # hold on to buffers, keeps memory alive
for name in df.column_names():
if not isinstance(name, str):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be typing.AnyStr, but I do not think we want bytes as column names?

Copy link
Member

Choose a reason for hiding this comment

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

Agreed that we don't want bytes.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @thomasjpfan!

@rgommers rgommers merged commit 60bedfe into data-apis:main Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants