Skip to content

Commit

Permalink
pull in pleb pre-commit cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cblades-tc committed Oct 3, 2024
1 parent 75306d4 commit eb146be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions tcex/api/tc/ti_transform/ti_predefined_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import hashlib
import json
import uuid
from collections.abc import Iterable
from inspect import _empty, signature
from typing import Iterable, TypedDict
from typing import TypedDict

# first-party
# first-part
Expand Down Expand Up @@ -110,9 +111,9 @@ def value_in(self, value, values: str, delimiter: str = ','):
"""Return the value if it is in the list of values, else return None."""
if not values.startswith('"'):
values.replace('"', '\"')
Values = f'"{values}"'
values = f'"{values}"'

return value if value in [v.strip() for v in json.loads(Values).split(delimiter)] else None
return value if value in [v.strip() for v in json.loads(values).split(delimiter)] else None

@custom_function_definition(
{
Expand Down Expand Up @@ -179,7 +180,7 @@ def to_lowercase(self, value):
return str.lower(value)

def to_titlecase(self, value):
"""Convert value to titlecase."""
"""Convert value to title case."""
return str.title(value)

def truncate(self, value, length: int, append_chars: str = '...'):
Expand Down
2 changes: 2 additions & 0 deletions tcex/api/tc/ti_transform/transform_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ class TransformException(Exception):
"""Base exception for transform errors."""

def __init__(self, field: str, cause: Exception, context: dict | None, *args) -> None:
"""."""
super().__init__(*args)
self.field = field
self.cause = cause
self.context = context

def __str__(self) -> str:
"""."""
return f'Error transforming {self.field}: {self.cause}'


Expand Down
2 changes: 1 addition & 1 deletion tcex/api/tc/v2/batch/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def add_key_value(self, key: str, value: str):
'externalDateCreated',
'externalDateExpires',
'externalLastModified',
'publishDate'
'publishDate',
}:
if value is not None:
self._group_data[key] = self.util.any_to_datetime(value).strftime(
Expand Down

0 comments on commit eb146be

Please sign in to comment.