Skip to content

add Column.dtype #166

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 9 commits into from
May 15, 2023
Merged

add Column.dtype #166

merged 9 commits into from
May 15, 2023

Conversation

MarcoGorelli
Copy link
Contributor

closes #165

@rgommers
Copy link
Member

Strangely enough CI is not happy with this:

docstring of dataframe_api.Column.dtype:1: WARNING: py:class reference target not found: dataframe_api._types.dtype

@jorisvandenbossche
Copy link
Member

Should this say something about the returned object? Or do just see it as an opaque object without any guarantees? (except that you can pass it to functions with an argument that expects a dtype?)

Or do we want to specify that certain attributes or methods are available? (eg is __eq__ expected to work)

@rgommers
Copy link
Member

Should this say something about the returned object? Or do just see it as an opaque object without any guarantees?

I'd say there are guarantees for dtypes that are returned, but that's gh-155 rather than this PR. We already use dtype in some places, and this PR is just one more - so this PR doesn't have to be the one to work out the hard part.

@MarcoGorelli
Copy link
Contributor Author

MarcoGorelli commented May 11, 2023

so this PR doesn't have to be the one to work out the hard part.

besides, the hard part of this PR is figuring out how to make it pass CI ;)

EDIT: done 🎉 it was just that def dtype shadows the dtype type. Solutions could either be import dtype as dtype_t, or rename def dtype to a function like def get_dtype. I've gone with the latter

@rgommers
Copy link
Member

it was just that def dtype shadows the dtype type. Solutions could either be import dtype as dtype_t, or rename def dtype to a function like def get_dtype. I've gone with the latter

I feel like the name chosen for type annotation earlier is a detail, and should not prevent choosing the most obvious name for the property (or method, but I think a .dtype property as you had it is best).

dtype_t works, although perhaps DType is better - I think that's the most often used solution, capitalize type annotation names.

@MarcoGorelli
Copy link
Contributor Author

perhaps DType is better

agreed, thanks, have gone with that

@MarcoGorelli MarcoGorelli requested a review from rgommers May 15, 2023 15:50
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.

This is green and seems as uncontroversial as it can get for an API addition, so let's get this in.

@rgommers rgommers merged commit 16aabbf into data-apis:main May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Column.dtype
3 participants