Myracle opened a new issue, #325:
URL: https://github.com/apache/flink-agents/issues/325

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/flink-agents/issues) and found nothing 
similar.
   
   ### Description
   
   Two records are put in one line. Report the error if run 
workflow_single_agent_example.py
   `pydantic_core._pydantic_core.ValidationError: 1 validation error for 
ProductReview
     Invalid JSON: trailing characters at line 1 column 79 [type=json_invalid, 
input_value='{"id": "B005AGO4LU", "re...eview": "Love the fit"}', 
input_type=str]
       For further information visit 
https://errors.pydantic.dev/2.11/v/json_invalid
   
        at 
org.apache.beam.runners.fnexecution.control.FnApiControlClient$ResponseStreamObserver.onNext(FnApiControlClient.java:180)
        at 
org.apache.beam.runners.fnexecution.control.FnApiControlClient$ResponseStreamObserver.onNext(FnApiControlClient.java:160)
        at 
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:262)
        at 
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
        at 
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.Contexts$ContextualizedServerCallListener.onMessage(Contexts.java:76)
        at 
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailableInternal(ServerCallImpl.java:332)
        at 
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailable(ServerCallImpl.java:315)
        at 
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable.runInContext(ServerImpl.java:834)
        at 
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at 
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
        ... 3 more`
   
   ### How to reproduce
   
   `import json
   
   json_str = '{"id": "B005AGO4LU", "review": "I wear these everyday to work, 
the gym, etc."}{"id": "B0058YEJ5K", "review": "Love the fit"}'
   
   try:
       data = json.loads(json_str)
   except json.JSONDecodeError as e:
       print(f"JSON error: {e}")
       if not json_str.strip().endswith('}'):
           json_str = json_str.rstrip() + '}'
           data = json.loads(json_str)`
   
   ### Version and environment
   
   The main branch
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to