From bde431ba64dbf38707e9b4201bb5a2e4e1f82732 Mon Sep 17 00:00:00 2001 From: "Shah, Karan" Date: Mon, 2 Dec 2024 20:12:52 +0530 Subject: [PATCH] Silence selected C901 errors Signed-off-by: Shah, Karan --- openfl/experimental/workflow/utilities/metaflow_utils.py | 4 ++-- openfl/experimental/workflow/utilities/runtime_utils.py | 2 +- openfl/experimental/workflow/workspace_export/export.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openfl/experimental/workflow/utilities/metaflow_utils.py b/openfl/experimental/workflow/utilities/metaflow_utils.py index 21f567a88f..559cbef5b3 100644 --- a/openfl/experimental/workflow/utilities/metaflow_utils.py +++ b/openfl/experimental/workflow/utilities/metaflow_utils.py @@ -158,7 +158,7 @@ def __init__(self, func_ast, decos, doc): # these attributes are populated by _postprocess self.is_inside_foreach = False - def _parse(self, func_ast): + def _parse(self, func_ast): # noqa: C901 self.num_args = len(func_ast.args.args) tail = func_ast.body[-1] @@ -319,7 +319,7 @@ def __init__( @only_if_not_done @require_mode("w") - def save_artifacts(self, artifacts_iter, force_v4=False, len_hint=0): + def save_artifacts(self, artifacts_iter, force_v4=False, len_hint=0): # noqa: C901 """Saves Metaflow Artifacts (Python objects) to the datastore and stores any relevant metadata needed to retrieve them. diff --git a/openfl/experimental/workflow/utilities/runtime_utils.py b/openfl/experimental/workflow/utilities/runtime_utils.py index c4c33acdf4..193941bc2e 100644 --- a/openfl/experimental/workflow/utilities/runtime_utils.py +++ b/openfl/experimental/workflow/utilities/runtime_utils.py @@ -69,7 +69,7 @@ def artifacts_iter(): return artifacts_iter, cls_attrs -def filter_attributes(ctx, f, **kwargs): +def filter_attributes(ctx, f, **kwargs): # noqa: C901 """Filters out attributes from the next task in the flow based on inclusion or exclusion. diff --git a/openfl/experimental/workflow/workspace_export/export.py b/openfl/experimental/workflow/workspace_export/export.py index 576a6c9204..52e5dab8f9 100644 --- a/openfl/experimental/workflow/workspace_export/export.py +++ b/openfl/experimental/workflow/workspace_export/export.py @@ -175,7 +175,7 @@ def __get_class_name_and_sourcecode_from_parent_class(self, parent_class): return None, None - def __extract_class_initializing_args(self, class_name): + def __extract_class_initializing_args(self, class_name): # noqa: C901 """Provided name of the class returns expected arguments and it's values in form of dictionary.""" instantiation_args = {"args": {}, "kwargs": {}} @@ -333,7 +333,7 @@ def update_dictionary(args: dict, data: dict, dtype: str = "args"): self.__write_yaml(plan, data) - def generate_data_yaml(self): + def generate_data_yaml(self): # noqa: C901 """Generates data.yaml.""" # Import python script if not already if not hasattr(self, "exported_script_module"):