Skip to content

Commit

Permalink
hotfix: extra string at the beginning of yaml in snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotzh committed Apr 25, 2024
1 parent 97f059e commit 4d5b1a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/promptflow-core/promptflow/_utils/flow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import os
import re
from collections import OrderedDict
from os import PathLike
from pathlib import Path
from typing import Optional, Tuple, Union
Expand Down Expand Up @@ -156,6 +157,8 @@ def dump_flow_dag(flow_dag: dict, flow_path: Path):
"""Dump flow dag to given flow path."""
flow_dir, flow_filename = resolve_flow_path(flow_path, check_flow_exist=False)
flow_path = flow_dir / flow_filename
if isinstance(flow_dag, OrderedDict):
flow_dag = dict(flow_dag)
with open(flow_path, "w", encoding=DEFAULT_ENCODING) as f:
dump_yaml(flow_dag, f)
return flow_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,8 @@ def test_flex_flow_run(
yaml_dict = load_yaml(local_storage._dag_path)
assert yaml_dict == expected_snapshot_yaml

assert not local_storage._dag_path.read_text().startswith("!!omap")

# actual result will be entry2:my_flow2
details = pf.get_details(run.name)
# convert DataFrame to dict
Expand Down

0 comments on commit 4d5b1a8

Please sign in to comment.