Skip to content

Commit

Permalink
Fixed load vtl to create path from string.
Browse files Browse the repository at this point in the history
  • Loading branch information
javihern98 committed Oct 1, 2024
1 parent 738f505 commit 612203c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/vtlengine/API/_InternalApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ def load_vtl(input: Union[str, Path]):
the file.
"""
if isinstance(input, str):
return input
try:
test = Path(input)
except Exception:
return input
input = test
if not isinstance(input, Path):
raise Exception('Invalid vtl file. Input is not a Path object')
if not input.exists():
Expand Down
2 changes: 1 addition & 1 deletion src/vtlengine/API/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def run(script: Union[str, Path], data_structures: Union[dict, Path, List[Union[
The data structure information is contained in the JSON file given,
and establish the datatype (string, integer or number),
and the role that each component is going to have (Identifier or Measure).
and the role that each component is going to have (Identifier, Attribute or Measure).
It can be a dictionary or a path to the JSON file or folder that contains it.
Moreover, a csv file with the data to operate with is going to be loaded.
Expand Down

0 comments on commit 612203c

Please sign in to comment.