Skip to content

Commit

Permalink
more deep copy removed
Browse files Browse the repository at this point in the history
  • Loading branch information
guzzijones committed Jan 30, 2024
1 parent 429f0e0 commit 25cf175
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions orquesta/specs/native/v1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.

import logging
import copy
import six
from six.moves import queue

Expand Down Expand Up @@ -205,7 +206,7 @@ def render(self, in_ctx):
return self, action_specs

def finalize_context(self, next_task_name, task_transition_meta, in_ctx):
rolling_ctx = json_util.deepcopy(in_ctx)
rolling_ctx = copy.copy(in_ctx)
new_ctx = {}
errors = []

Expand Down Expand Up @@ -640,7 +641,8 @@ def __init__(self, spec, name=None, member=False):
super(WorkflowSpec, self).__init__(spec, name=name, member=member)

def render_input(self, runtime_inputs, in_ctx=None):
rolling_ctx = json_util.deepcopy(in_ctx) if in_ctx else {}
# only replacing top key values in dict a copy is fine here
rolling_ctx = copy.copy(in_ctx) if in_ctx else {}
errors = []

for input_spec in getattr(self, "input") or []:
Expand All @@ -662,7 +664,8 @@ def render_input(self, runtime_inputs, in_ctx=None):
return rolling_ctx, errors

def render_vars(self, in_ctx):
rolling_ctx = json_util.deepcopy(in_ctx)
# only replacing top key values in dict a copy is fine here
rolling_ctx = copy.copy(in_ctx)
rendered_vars = {}
errors = []

Expand All @@ -681,7 +684,7 @@ def render_vars(self, in_ctx):

def render_output(self, in_ctx):
output_specs = getattr(self, "output") or []
rolling_ctx = json_util.deepcopy(in_ctx)
rolling_ctx = copy.copy(in_ctx)
rendered_outputs = {}
errors = []

Expand Down

0 comments on commit 25cf175

Please sign in to comment.