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

ARROW-3531: [Python] add Schema.field() method / deprecate field_by_name #5165

Conversation

jorisvandenbossche
Copy link
Member

https://issues.apache.org/jira/browse/ARROW-3531

  • add Schema.field(i) (similarly as Table.field(i), Table.column(i), etc)
  • deprecate Schema.field_by_name(name) in favor of the above
  • expand Table.field(i) to also accept string name (similar as Table.column(i)
  • harmonize some of the code to check out of bounds indices (using _normalize_index)

@wesm
Copy link
Member

wesm commented Aug 22, 2019

I'm not sure we should go too crazy with overloading methods to take both names (to look up in a hash table) vs integers, but this seems ok. @pitrou seem OK?

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

@wesm wesm closed this in 6cbaf72 Aug 23, 2019
@jorisvandenbossche jorisvandenbossche deleted the ARROW-3531-schema-field branch August 23, 2019 06:37
@jorisvandenbossche
Copy link
Member Author

I'm not sure we should go too crazy with overloading methods to take both names vs integers

Yeah, I agree we should be careful about that, I was mainly following what Table.column(..) did. Luckily in arrow the difference between integer or string is clear (unlike in pandas where an integer could also be a name ..)

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.

None yet

3 participants