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

Add post_func_skip_list to control execution of post functions #644

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from
Open
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions dpdata/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@
self.data = {**self.data, **data}
self.check_data()
if hasattr(fmtobj.from_system, "post_func"):
post_func_skip_list = kwargs.get("post_func_skip_list", [])
ZLI-afk marked this conversation as resolved.
Show resolved Hide resolved
if not isinstance(post_func_skip_list, list):
post_func_skip_list = [post_func_skip_list]

Check warning on line 234 in dpdata/system.py

View check run for this annotation

Codecov / codecov/patch

dpdata/system.py#L234

Added line #L234 was not covered by tests
for post_f in fmtobj.from_system.post_func:
if post_f in post_func_skip_list:
continue

Check warning on line 237 in dpdata/system.py

View check run for this annotation

Codecov / codecov/patch

dpdata/system.py#L237

Added line #L237 was not covered by tests
self.post_funcs.get_plugin(post_f)(self)
return self

Expand Down