Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _parse_prefixed_args(args: List[str], prefix: str) -> Dict[str, str]:
for _, arg in enumerate(args):
if arg.startswith(prefix):
if "=" in arg:
arg_name, arg_value = arg.split("=")
arg_name, arg_value = arg.split("=", 1)
if len(arg_name) > len(prefix):
parsed[arg_name[len(prefix) :]] = arg_value
elif pre_arg_name is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ---------------------------------------------------------
from pathlib import Path

from promptflow.parallel._config.parser import parse
from promptflow.parallel._config.parser import _parse_prefixed_args, parse


def test_parse_correct_type():
Expand Down Expand Up @@ -51,3 +51,9 @@ def test_parse_correct_type():
assert config.debug_output_dir == Path("/test_debug")
assert config.logging_level == "INFO"
assert not config.is_debug_enabled


def test_parse_prefixed_args_value_with_equals():
# Values containing '=' (e.g. base64 padding) must not crash with ValueError.
result = _parse_prefixed_args(["--pf_input_token=SGVsbG8gV29ybGQ="], "--pf_input_")
assert result == {"token": "SGVsbG8gV29ybGQ="}
Loading