Skip to content
Snippets Groups Projects
Commit b95c65fe authored by leufen1's avatar leufen1
Browse files

ensure that file is removed and also that data origin parameter is not mutable

parent 5bc89f88
Branches
Tags
6 merge requests!430update recent developments,!413update release branch,!412Resolve "release v2.0.0",!374Lukas issue339 feat filter with future mix,!373try out bugfix,!372Draft: Resolve "BUG: wrong time extend when using lazy preprocessing"
Pipeline #86292 passed
...@@ -276,6 +276,7 @@ class DataHandlerSingleStation(AbstractDataHandler): ...@@ -276,6 +276,7 @@ class DataHandlerSingleStation(AbstractDataHandler):
filename = os.path.join(self.lazy_path, hash + ".pickle") filename = os.path.join(self.lazy_path, hash + ".pickle")
try: try:
if self.overwrite_lazy_data is True: if self.overwrite_lazy_data is True:
os.remove(filename)
raise FileNotFoundError raise FileNotFoundError
with open(filename, "rb") as pickle_file: with open(filename, "rb") as pickle_file:
lazy_data = dill.load(pickle_file) lazy_data = dill.load(pickle_file)
......
...@@ -43,6 +43,9 @@ def download_join(station_name: Union[str, List[str]], stat_var: dict, station_t ...@@ -43,6 +43,9 @@ def download_join(station_name: Union[str, List[str]], stat_var: dict, station_t
# make sure station_name parameter is a list # make sure station_name parameter is a list
station_name = helpers.to_list(station_name) station_name = helpers.to_list(station_name)
# also ensure that given data_origin dict is no reference
data_origin = None if data_origin is None else {k: v for (k, v) in data_origin.items()}
# get data connection settings # get data connection settings
join_url_base, headers = join_settings(sampling) join_url_base, headers = join_settings(sampling)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment