Skip to content

Commit

Permalink
chore: change hook create from copy to deepcopy because of nested key…
Browse files Browse the repository at this point in the history
… update
  • Loading branch information
robcxyz committed Dec 31, 2023
1 parent e0ea73c commit 0e2215b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tackle/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import typing
import typing as typing_types
from copy import deepcopy
from functools import partial, partialmethod
from typing import Annotated, Any, Callable, Optional, Type, TypeVar, Union

Expand Down Expand Up @@ -121,9 +122,7 @@ def dcl_hook_exec(
input_element = {tmp_key: input_element}

hook_context.data.input = input_element
public_data = get_public_data_from_walk(
context=hook_context, value=input_element.copy()
)
public_data = get_public_data_from_walk(context=hook_context, value=input_element)
if tmp_key:
return public_data[tmp_key]
return public_data
Expand Down Expand Up @@ -804,7 +803,7 @@ def create_dcl_method(
return create_dcl_hook(
context=context,
hook_name=arg,
hook_input_raw=method.input_raw.copy(),
hook_input_raw=method.input_raw,
)


Expand Down Expand Up @@ -864,7 +863,7 @@ def get_hooks_from_namespace(
Hook = create_dcl_hook(
context=context,
hook_name=hook_name,
hook_input_raw=Hook.input_raw.copy(),
hook_input_raw=deepcopy(Hook.input_raw),
)
return Hook

Expand Down

0 comments on commit 0e2215b

Please sign in to comment.