Commits


Joris Van den Bossche authored and GitHub committed 6252e9ceeb0
GH-44962: [Python] Clean-up name / field_name handling in pandas compat (#44963) ### Rationale for this change Small part of https://github.com/apache/arrow/pull/44195 factored out into its own PR because this change is just a small refactor making https://github.com/apache/arrow/pull/44195 easier to do, but in itself not changing any logic. We currently both store `name` and `field_name` in the pandas metadata. `field_name` is guaranteed to be a string, and is always exactly the name used in the arrow schema. `name` can also be None if the original pandas DataFrame used None as the column label or if it was coming from an index level without name. Right now we had several places where we used `name` but then checked for it being None. With this PR I made it more consistently use `field_name` in the cases it needs the string version, by more consistently passing through both names a field_names. ### Are these changes tested? Existing tests should cover this ### Are there any user-facing changes? No * Issue: #44962 * GitHub Issue: #44962 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>