Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up warnings in tests and at runtime. #1027

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion snowfakery/data_generator_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions snowfakery/standard_plugins/Schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions snowfakery/standard_plugins/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading