jorisvandenbossche commented on code in PR #445:
URL: https://github.com/apache/arrow-nanoarrow/pull/445#discussion_r1586129139
##########
python/src/nanoarrow/schema.py:
##########
@@ -957,14 +988,113 @@ def struct(fields, nullable=True) -> Schema:
>>> import nanoarrow as na
>>> na.struct([na.int32()])
Schema(STRUCT, fields=[Schema(INT32)])
- >>> na.struct([("col1", na.int32())])
- Schema(STRUCT, fields=[Schema(INT32, name='col1')])
>>> na.struct({"col1": na.int32()})
Schema(STRUCT, fields=[Schema(INT32, name='col1')])
"""
return Schema(Type.STRUCT, fields=fields, nullable=nullable)
+def list_of(value_type, nullable=True) -> Schema:
Review Comment:
> In R we have `vctrs::list_of()` but if your brain didn't go there
An average Python programmer like has never heard of `vctrs::list_of()` ;)
##########
python/src/nanoarrow/schema.py:
##########
@@ -957,14 +988,113 @@ def struct(fields, nullable=True) -> Schema:
>>> import nanoarrow as na
>>> na.struct([na.int32()])
Schema(STRUCT, fields=[Schema(INT32)])
- >>> na.struct([("col1", na.int32())])
- Schema(STRUCT, fields=[Schema(INT32, name='col1')])
>>> na.struct({"col1": na.int32()})
Schema(STRUCT, fields=[Schema(INT32, name='col1')])
"""
return Schema(Type.STRUCT, fields=fields, nullable=nullable)
+def list_of(value_type, nullable=True) -> Schema:
Review Comment:
> In R we have `vctrs::list_of()` but if your brain didn't go there
An average Python programmer like me has never heard of `vctrs::list_of()` ;)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]