Skip to content

fix: fix service util bug #160

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

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Changes from all commits
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
9 changes: 5 additions & 4 deletions src/spaceone/core/service/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def change_value_by_rule(rule: str, param_key: str, value: any = None) -> any:
def wrapper(func: callable) -> callable:
@functools.wraps(func)
def wrapped_func(cls, params: dict) -> Union[dict, types.GeneratorType]:
if param_value := params.get(param_key):
if param_key in params:
param_value = params[param_key]
if rule == "APPEND":
if isinstance(param_value, list):
param_value.append(value)
Expand Down Expand Up @@ -287,7 +288,7 @@ def wrapped_func(cls, params):


def change_timestamp_value(
timestamp_keys=None, timestamp_format="google_timestamp"
timestamp_keys=None, timestamp_format="google_timestamp"
) -> callable:
if timestamp_keys is None:
timestamp_keys = []
Expand Down Expand Up @@ -339,7 +340,7 @@ def wrapped_func(cls, params):


def change_timestamp_filter(
filter_keys=None, timestamp_format="google_timestamp"
filter_keys=None, timestamp_format="google_timestamp"
) -> callable:
if filter_keys is None:
filter_keys = []
Expand Down Expand Up @@ -377,7 +378,7 @@ def _is_null(value) -> bool:


def _change_timestamp_condition(
query_filter, filter_keys, filter_type, timestamp_format
query_filter, filter_keys, filter_type, timestamp_format
) -> list:
change_filter = []

Expand Down
Loading