INNER CODE UNIT · Python
_fetch_and_stringify_literal_map
flyteorg/flytekit · flytekit/clis/flyte_cli/main.py:111
def _fetch_and_stringify_literal_map(path, verbose=False):
"""
:param Text path:
:param bool verbose:
:rtype: Text
"""
ctx = FlyteContextManager.current_context()
with utils.AutoDeletingTempDir("flytecli") as tmp:
try:
fname = tmp.get_named_tempfile("literalmap.pb")
ctx.file_access.get_data(path, fname)
literal_map = _literals.LiteralMap.from_flyte_idl(
utils.load_proto_from_file(_literals_pb2.LiteralMap, fname)
)
return _get_io_string(literal_map, verbose=verbose)
except Exception:
return "Failed to pull data from {}. Do you have permissions?".format(path)