diff --git a/pillar_tool/db/queries/pillar_queries.py b/pillar_tool/db/queries/pillar_queries.py index 83ae0b8..70b4e13 100644 --- a/pillar_tool/db/queries/pillar_queries.py +++ b/pillar_tool/db/queries/pillar_queries.py @@ -13,12 +13,12 @@ def get_pillar_name_sequence(name: str) -> list[str]: def decode_pillar_value(pillar: Pillar) -> str | int | float | bool | list | dict: match pillar.parameter_type: - case 'string': return json.loads(pillar.value) - case 'integer': return json.loads(pillar.value) - case 'float': return json.loads(pillar.value) - case 'boolean': return json.loads(pillar.value) - case 'list': return json.loads(pillar.value) - case 'dict': return json.loads(pillar.value) + case 'string': return str(json.loads(pillar.value)) + case 'integer': return int(json.loads(pillar.value)) + case 'float': return float(json.loads(pillar.value)) + case 'boolean': return bool(json.loads(pillar.value)) + case 'list': return list(json.loads(pillar.value)) + case 'dict': return dict(json.loads(pillar.value)) raise RuntimeError(f"Failed to decode pillar value: Invalid type '{pillar.parameter_type}'")