Skip to content

Commit

Permalink
vdk-core: Accept string as job_path in JobConfig (#2251)
Browse files Browse the repository at this point in the history
Currently, the JobConfig class accepts only pathlib.Path as
data_job_path. This, however, causes unnecesary warnings when a string
is passed as job path.

This change updates the type annotation of the init to support both
pathlib.Path and string as data_job_path.

Testing Done: CI/CD

Signed-off-by: Andon Andonov <andonova@vmware.com>
  • Loading branch information
doks5 authored and murphp15 committed Jun 21, 2023
1 parent 357347c commit 64e46bf
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from enum import Enum
from typing import Dict
from typing import List
from typing import Union

from vdk.internal.core.config import convert_value_to_type_of_default_type
from vdk.internal.core.errors import ErrorMessage
Expand Down Expand Up @@ -40,7 +41,7 @@ class JobConfig:
For more see the user wiki
"""

def __init__(self, data_job_path: pathlib.Path):
def __init__(self, data_job_path: Union[pathlib.Path, str]):
self._config_ini = configparser.ConfigParser()
self._config_file = os.path.join(data_job_path, "config.ini")

Expand Down

0 comments on commit 64e46bf

Please sign in to comment.