Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…43481) ### Rationale for this change Currently you cannot directly access the names of all the fields within a StructType, and it is not obvious how to access each field either. This change allows people to directly access the fields and their names directly. See #30058. ### What changes are included in this PR? I added a .names and .fields attribute to StructType. .names returns a list of the names of the fields in the StructType, and .fields returns a list of the fields in the StructType. ### Are these changes tested? Yes. I made two tests to check if the new .names and .fields attributes would operate as intended. The tests check if the .names attribute would return a list of the names of each field and if .fields returns a list of the fields. ### Are there any user-facing changes? Yes, there are two new attributes users can now use. * GitHub Issue: #30058 Authored-by: Abhinand-J <wabhinandj@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
- Loading branch information