diff --git a/snowfakery/data_generator_runtime.py b/snowfakery/data_generator_runtime.py index 77ced033..7f451e6a 100644 --- a/snowfakery/data_generator_runtime.py +++ b/snowfakery/data_generator_runtime.py @@ -426,7 +426,7 @@ def __exit__(self, *args): try: plugin.close() except Exception as e: - warn(f"Could not close {plugin} because {e}") + warn(f"Could not close {plugin} because {repr(e)}") self.current_context = None self.plugin_instances = None self.plugin_function_libraries = None diff --git a/snowfakery/standard_plugins/Schedule.py b/snowfakery/standard_plugins/Schedule.py index 95fa6119..ba702465 100644 --- a/snowfakery/standard_plugins/Schedule.py +++ b/snowfakery/standard_plugins/Schedule.py @@ -236,7 +236,7 @@ def _process_special_cases( add_date = self.ruleset.rdate else: # pragma: no cover - Should be unreachable assert action in ("include", "exclude"), "Bad action!" - raise NotImplementedError() + raise NotImplementedError("Bad action!") if isinstance(case, (list, tuple)): for case in case: @@ -338,7 +338,7 @@ def next(self) -> None: # pragma: no cover """This method is never called. It is replaced at runtime by _next_datetime or _next_date""" - raise NotImplementedError() + raise NotImplementedError("next is not implemented") def _next_datetime(self) -> datetime: return next(self.iterator) diff --git a/snowfakery/standard_plugins/datasets.py b/snowfakery/standard_plugins/datasets.py index ed10530f..318d7377 100644 --- a/snowfakery/standard_plugins/datasets.py +++ b/snowfakery/standard_plugins/datasets.py @@ -190,13 +190,17 @@ def _get_dataset_instance(self, plugin_context, iteration_mode, kwargs): return dataset_instance def _load_dataset(self, iteration_mode, rootpath, kwargs): - raise NotImplementedError() + raise NotImplementedError("_load_dataset not implemented") def close(self): - raise NotImplementedError() + raise NotImplementedError("close not implemented: " + repr(self)) class FileDataset(DatasetBase): + + def close(self): + pass + def _load_dataset(self, iteration_mode, rootpath, kwargs): dataset = kwargs.get("dataset") tablename = kwargs.get("table")