diagridio / catalyst-feedback

Provide Diagrid Catalyst Feedback
https://diagrid.ws/catalyst-early-access
1 stars 1 forks source link

Bug Report: Saving Data as JSON to upstash Redis DB throws Exception #25

Open trey-rosius opened 1 month ago

trey-rosius commented 1 month ago

Describe the bug To save data as JSON to a state, a state_metadata key-value (state_metadata={"contentType": "application/json"}) pair has to be passed into the save_state dapr function.

 d.save_state(
                store_name=payments_db,
                key=payment.id,
                value=payment.model_dump_json(),
                state_metadata={"contentType": "application/json"}
            )

When the state store is an Upstash Redis DB, the state saves fine, but returns this exception.

{
    "detail": "failed saving state in state store payments-db: failed to set key payment-service||pi_3Q2BO6CYYUBUpUBM1WQijSxM: ERR Error running script: @user_script:15: the legacy path syntax is not supported. JSONPath must start with $ stack traceback:  [G]: in function 'call'  @user_script:15: in main chunk  [G]: ?"
}

If you remove the state_metadata key/value pair, no exception is thrown and the state saves properly.

To Reproduce You'll have to clone this repo https://github.com/trey-rosius/payment_service and connect to an upstash redis DB(https://upstash.com/).

Expected behavior Expected no exception to be thrown when saving state

Screenshots Screenshot 2024-09-23 at 13 43 03 Screenshot 2024-09-23 at 13 43 11

Additional context

kendallroden commented 1 month ago

We are on it