pegasystems / pega-datascientist-tools

Pega Data Scientist Tools
https://github.com/pegasystems/pega-datascientist-tools/wiki
Apache License 2.0
33 stars 24 forks source link

_delete_temp_files in generateReport is _way_ too aggressive. #213

Closed StijnKas closed 1 week ago

StijnKas commented 4 months ago

pdstools version checks

Issue description

The _delete_temp_files method in generateReport of the ADMDatamart class is way too aggressive.

https://github.com/pegasystems/pega-datascientist-tools/blob/master/python/pdstools/adm/ADMDatamart.py#L1657

By default, it currently deletes all [".yaml", ".qmd", ".ipynb", ".arrow"] files in the working directory.

Considering that, by default, the working directory is the current directory, this will remove all files with these types from the local directory, and since it's using OS commands they're not put in the thrash either. It already accidentally removed a few notebooks and other cached files that i had there locally.

Reproducible example

Have files in your current directory, then run generateReport

Expected behavior

We should make sure it only deletes the cached files that we write for the health check, and only the files used to generate this specific health check run.

Installed versions

``` Replace this line with the output of pdstools.show_versions(), leave the backticks in place ```
StijnKas commented 1 week ago

Closed by https://github.com/pegasystems/pega-datascientist-tools/pull/253