You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/12 14:02:30 UTC

[GitHub] [arrow] AlenkaF commented on a diff in pull request #12863: ARROW-11259: [Python] Allow to create field reference to nested field

AlenkaF commented on code in PR #12863:
URL: https://github.com/apache/arrow/pull/12863#discussion_r848475601


##########
python/pyarrow/compute.py:
##########
@@ -597,16 +597,29 @@ def field(name_or_index):
     Stores only the field's name. Type and other information is known only when
     the expression is bound to a dataset having an explicit scheme.
 
+    Nested references are allowed by passing a tuple of names.
+    For example ``('foo', 'bar')`` references the field named "bar" inside
+    the field named "foo".
+
     Parameters
     ----------
-    name_or_index : string or int
-        The name or index of the field the expression references to.
+    name_or_index : string, tuple or int
+        The name or index of the (possibly nested) field the expression
+        references to.
 
     Returns
     -------
     field_expr : Expression
     """
-    return Expression._field(name_or_index)
+    if isinstance(name_or_index, str) or isinstance(name_or_index, int):

Review Comment:
   🤩 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org