fix: allow recipes.jsonsplit to pass through NULL values

Table.convert with jsonsplit raised OperationalError on NULL cells
because None.split was called. Match parsedate and return None unchanged.
This commit is contained in:
santhreal 2026-07-17 22:37:44 -07:00
commit 4f4d823f1c
2 changed files with 6 additions and 2 deletions

View file

@ -68,9 +68,11 @@ def parsedatetime(
def jsonsplit(
value: str, delimiter: str = ",", type: Callable[[str], object] = str
) -> str:
value: Optional[str], delimiter: str = ",", type: Callable[[str], object] = str
) -> Optional[str]:
"""
Convert a string like a,b,c into a JSON array ["a", "b", "c"]
"""
if value is None:
return value
return json.dumps([type(s.strip()) for s in value.split(delimiter)])