Demo:
from workers import WorkerEntrypoint, Response
class Default(WorkerEntrypoint):
async def fetch(self, request):
try:
self.env.ANALYTICS.writeDataPoint(
{
"blobs": ["blob1", "blob2"],
"doubles": [1.0, 2.5],
"indexes": ["idx"],
}
)
except Exception as inst:
return Response(str(inst))
return Response("Hello world!")
After wrangler deploy, curl says:
TypeError: Incorrect type for the 'indexes' field on 'AnalyticsEngineEvent': the provided value is not of type 'Array'.
Demo:
After
wrangler deploy, curl says: