Skip to content

Commit

Permalink
fix: truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsneto committed Aug 26, 2024
1 parent 21b7269 commit 80b7fe9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cereja/utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def truncate(data: Union[Sequence], k_iter: int = 0, k_str: int = 0, k_dict_keys
assert all(isinstance(k, int) and k >= 0 for k in
(k_iter, k_str, k_dict_keys)), 'k parameters should be an integer equal to or larger than 0'

data = copy(data)
if isinstance(data, dict):
if k_dict_keys:
data = {key: data.get(key, '<…>') for key in truncate(list(data.keys()), k_dict_keys)}
Expand Down

0 comments on commit 80b7fe9

Please sign in to comment.