timsaucer commented on code in PR #1435:
URL:
https://github.com/apache/datafusion-python/pull/1435#discussion_r3001326632
##########
python/datafusion/functions.py:
##########
@@ -490,6 +502,13 @@ def alias(expr: Expr, name: str, metadata: dict[str, str]
| None = None) -> Expr
... dfn.functions.alias(dfn.col("a"), "b")
... ).collect_column("b")[0].as_py()
1
+
+ >>> df.select(
+ ... dfn.functions.alias(
+ ... dfn.col("a"), "b", metadata={"info": "test"}
+ ... )
+ ... ).collect_column("b")[0].as_py()
+ 1
Review Comment:
```
df.select(
dfn.functions.alias(
dfn.col("a"), "b", metadata={"info": "test"}
)
).schema()
```
This does show the metadata. Converting to pyarrow scalar appears to drop
it. Converting to a pyarrow table does keep the metadata on the table, but then
selecting the appropriate array still you can't see the metadata. :|
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]