Hello! I’m trying to convert a Python dict to a Li...
# ask-the-community
r
Hello! I’m trying to convert a Python dict to a LiteralMap and found the DictTransformer class. It states:
Transformer that transforms a univariate dictionary Dict[str, T] to a Literal Map
But it only seems to be able to transform it into a Literal. So how do I go from a Literal to a LiteralMap?
s
LiteralMap maps text to literals. In the case of a dictionary, Literal is set to LiteralMap: https://github.com/flyteorg/flytekit/blob/1311ea47242e4f32a9dc0769b6a51554ab41ee80/flytekit/core/type_engine.py#L1194-L1210.
May I know your use case?
120 Views