Skip to content

Commit

Permalink
Fixed check_output_folder to ensure the folder exists and does not re…
Browse files Browse the repository at this point in the history
…ferences to a file. Fixed memory reference on simple assignments.
  • Loading branch information
javihern98 committed Oct 1, 2024
1 parent c838b5f commit 738f505
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/vtlengine/API/_InternalApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ def _check_output_folder(output_folder: Union[str, Path]):
except Exception:
raise Exception('Output folder must be a Path or S3 URI to a directory')

if not isinstance(output_folder, Path) or not output_folder.is_dir():
if not isinstance(output_folder, Path):
raise Exception('Output folder must be a Path or S3 URI to a directory')
if not output_folder.exists():
if output_folder.suffix != '':
raise Exception('Output folder must be a Path or S3 URI to a directory')
os.mkdir(output_folder)
2 changes: 1 addition & 1 deletion src/vtlengine/Interpreter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def visit_Start(self, node: AST.Start) -> Any:
if result is None:
continue
# Save results
self.datasets[result.name] = result
self.datasets[result.name] = copy(result)
results[result.name] = result
self._save_datapoints_efficient(statement_num)
statement_num += 1
Expand Down

0 comments on commit 738f505

Please sign in to comment.