diff --git a/ibis/expr/operations/maps.py b/ibis/expr/operations/maps.py index edd4d0505c90e..7d3b31d3d29bc 100644 --- a/ibis/expr/operations/maps.py +++ b/ibis/expr/operations/maps.py @@ -10,6 +10,8 @@ @public class Map(Value): + """Construct a map.""" + keys: Value[dt.Array] values: Value[dt.Array] @@ -25,12 +27,16 @@ def dtype(self): @public class MapLength(Unary): + """Compute the number of unique keys in a map.""" + arg: Value[dt.Map] dtype = dt.int64 @public class MapGet(Value): + """Get a value from a map by key.""" + arg: Value[dt.Map] key: Value default: Value = None @@ -44,6 +50,8 @@ def dtype(self): @public class MapContains(Value): + """Check if a map contains a key.""" + arg: Value[dt.Map] key: Value @@ -53,6 +61,8 @@ class MapContains(Value): @public class MapKeys(Unary): + """Get the keys of a map as an array.""" + arg: Value[dt.Map] @attribute @@ -62,6 +72,8 @@ def dtype(self): @public class MapValues(Unary): + """Get the values of a map as an array.""" + arg: Value[dt.Map] @attribute @@ -71,6 +83,11 @@ def dtype(self): @public class MapMerge(Value): + """Combine two maps into one. + + If a key is present in both maps, the value from the first is kept. + """ + left: Value[dt.Map] right: Value[dt.Map]