Make sure that debug=True and params={'debug': True} behaves the same way (#2442)

* Make sure that debug=True and params={'debug': True} behaves the same way

* Update Documentation & Code Style

* Account for the possibility of node_input being None

* Fix condition

* Avoid situation where params=None

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Sara Zan 2022-04-26 09:24:19 +02:00 committed by GitHub
parent 60ff46e4e1
commit 34bca2ba83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -647,7 +647,12 @@ class Pipeline(BasePipeline):
# Apply debug attributes to the node input params
# NOTE: global debug attributes will override the value specified
# in each node's params dictionary.
if debug is None and node_input:
if node_input.get("params", {}):
debug = params.get("debug", None) # type: ignore
if debug is not None:
if not node_input.get("params", None):
node_input["params"] = {}
if node_id not in node_input["params"].keys():
node_input["params"][node_id] = {}
node_input["params"][node_id]["debug"] = debug