-
-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
enhancementNew feature or requestNew feature or requestpending author responseA question was asked or some work is pendingA question was asked or some work is pending
Description
Using relative config files in dicts doesn't work. It might be that I'm not using the correct syntax tho
To reproduce
3 files in the same directory
cli.py
from jsonargparse import CLI
from typing import Dict, List
class MyObject:
def __init__(self, x: int) -> None:
self.x = x
class MyCLI:
def __init__(self, d: Dict[str, MyObject]) -> None:
self.d = d
CLI(MyCLI)
(If you use a List
instead of Dict
for d
param, same error happens)
main.yaml
d:
obj1: ./my_obj.yaml
my_obj.yaml
class_path: cli.MyObj
init_args:
x: 3
Command: python cli.py --config main.yaml
. Raises
error: Parser key "d":
Unexpected import path format: ./my_obj.yaml
As I said it might not be a bug. I'm using python 3.8, but in the project that triggered this error I'm using python 3.9.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpending author responseA question was asked or some work is pendingA question was asked or some work is pending