diff --git a/ibis/expr/types/strings.py b/ibis/expr/types/strings.py index 6383fe613256..f1aaad06b352 100644 --- a/ibis/expr/types/strings.py +++ b/ibis/expr/types/strings.py @@ -455,7 +455,7 @@ def hashbytes( self, how: Literal["md5", "sha1", "sha256", "sha512"] = "sha256", ) -> ir.BinaryValue: - """Compute the binary hash value of the input. + r"""Compute the binary hash value of the input. Parameters ---------- @@ -466,6 +466,12 @@ def hashbytes( ------- BinaryValue Binary expression + + Examples + -------- + >>> import ibis + >>> str_lit = ibis.literal("hello") + >>> result = str_lit.hashbytes("md5") # b']A@*\xbcK*v\xb9q\x9d\x91\x10\x17\xc5\x92' """ return ops.HashBytes(self, how).to_expr() @@ -492,7 +498,7 @@ def hexdigest( >>> t = ibis.memtable({"species": ["Adelie", "Chinstrap", "Gentoo"]}) >>> t.species.hexdigest() ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ HexDigest(species) ┃ + ┃ HexDigest(species) ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ string │ ├──────────────────────────────────────────────────────────────────┤