(kwargs: dict, key: str, max_length: int)
| 55 | |
| 56 | @staticmethod |
| 57 | def _truncate_strings(kwargs: dict, key: str, max_length: int): |
| 58 | if key in kwargs: |
| 59 | x: str = kwargs[key] |
| 60 | if x and len(x) > max_length: |
| 61 | kwargs[key] = f"{x[:max_length-3]}..." |
| 62 | log.warning(f"{key} currently '{x}'") |
| 63 | log.warning(f"{key} must be less than {max_length} characters, truncating") |
| 64 | # raise DPClientError(f"{key} must be less than {max_length} characters, '{x}'") |
| 65 | |
| 66 | def _add_attributes(self, **kwargs): |
| 67 | self._attributes.update(mk_attribs(**kwargs)) |