https://flyte.org logo
#ask-the-community
Title
# ask-the-community
r

Robin Timan

01/10/2023, 9:46 AM
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

Samhita Alla

01/10/2023, 1:58 PM
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?
4 Views