Skip to content

Commit f3707f3

Browse files
authored
Workaround for ArrayValueSerializer can fail hard with ConversionSyntax exception
1 parent 08a896a commit f3707f3

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

backend/src/baserow/contrib/database/api/fields/serializers.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from drf_spectacular.types import OpenApiTypes
1010
from drf_spectacular.utils import extend_schema_field
11+
from loguru import logger
1112
from rest_framework import serializers
1213
from rest_framework.serializers import SkipField, empty
1314

@@ -227,7 +228,14 @@ def __init__(self, child, *args, **kwargs):
227228
self.fields["value"] = child
228229

229230
def to_representation(self, instance):
230-
return super().to_representation(instance)
231+
# Note this is workaround for https://github.com/baserow/baserow/issues/4424
232+
# Once we have a proper way to handle this, we can remove this
233+
# and return the super().to_representation(instance) directly.
234+
try:
235+
return super().to_representation(instance)
236+
except Exception:
237+
logger.exception("Mismatch between field type and value type")
238+
return []
231239

232240

233241
class LinkRowValueSerializer(serializers.Serializer):
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "bug",
3+
"message": "Do not fail hard when ArrayValueSerializer throws ConversionSyntax exception",
4+
"issue_origin": "github",
5+
"issue_number": 4424,
6+
"domain": "database",
7+
"bullet_points": [],
8+
"created_at": "2025-12-11"
9+
}

0 commit comments

Comments
 (0)