MCPcopy Create free account
hub / github.com/python-arq/arq / truncate

Function truncate

arq/utils.py:115–124  ·  view source on GitHub ↗

Truncate a string and add an ellipsis (three dots) to the end if it was too long :param s: string to possibly truncate :param length: length to truncate the string to

(s: str, length: int = DEFAULT_CURTAIL)

Source from the content-addressed store, hash-verified

113
114
115def truncate(s: str, length: int = DEFAULT_CURTAIL) -> str:
116 """
117 Truncate a string and add an ellipsis (three dots) to the end if it was too long
118
119 :param s: string to possibly truncate
120 :param length: length to truncate the string to
121 """
122 if len(s) > length:
123 s = s[: length - 1] + '…'
124 return s
125
126
127def args_to_string(args: Sequence[Any], kwargs: dict[str, Any]) -> str:

Callers 2

args_to_stringFunction · 0.85
run_jobMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…