Skip to content

Commit c942bf3

Browse files
committed
Add sha outputs
1 parent caed236 commit c942bf3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

python/datafusion/functions.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,8 @@ def sha224(arg: Expr) -> Expr:
11301130
>>> result = df.select(
11311131
... dfn.functions.sha224(dfn.col("a")).alias("h")
11321132
... )
1133-
>>> len(result.collect_column("h")[0].as_py()) > 0
1134-
True
1133+
>>> result.collect_column("h")[0].as_py().hex()
1134+
'ea09ae9cc6768c50fcee903ed054556e5bfc8347907f12598aa24193'
11351135
"""
11361136
return Expr(f.sha224(arg.expr))
11371137

@@ -1146,8 +1146,8 @@ def sha256(arg: Expr) -> Expr:
11461146
>>> result = df.select(
11471147
... dfn.functions.sha256(dfn.col("a")).alias("h")
11481148
... )
1149-
>>> len(result.collect_column("h")[0].as_py()) > 0
1150-
True
1149+
>>> result.collect_column("h")[0].as_py().hex()
1150+
'2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824'
11511151
"""
11521152
return Expr(f.sha256(arg.expr))
11531153

@@ -1162,8 +1162,8 @@ def sha384(arg: Expr) -> Expr:
11621162
>>> result = df.select(
11631163
... dfn.functions.sha384(dfn.col("a")).alias("h")
11641164
... )
1165-
>>> len(result.collect_column("h")[0].as_py()) > 0
1166-
True
1165+
>>> result.collect_column("h")[0].as_py().hex()
1166+
'59e1748777448c69de6b800d7a33bbfb9ff1b...
11671167
"""
11681168
return Expr(f.sha384(arg.expr))
11691169

@@ -1178,8 +1178,8 @@ def sha512(arg: Expr) -> Expr:
11781178
>>> result = df.select(
11791179
... dfn.functions.sha512(dfn.col("a")).alias("h")
11801180
... )
1181-
>>> len(result.collect_column("h")[0].as_py()) > 0
1182-
True
1181+
>>> result.collect_column("h")[0].as_py().hex()
1182+
'9b71d224bd62f3785d96d46ad3ea3d73319bfb...
11831183
"""
11841184
return Expr(f.sha512(arg.expr))
11851185

0 commit comments

Comments
 (0)