PG1204 opened a new pull request, #8872: URL: https://github.com/apache/texera/pull/8872
### What changes were proposed in this PR? `AudioTaskCodegen.parsePython` used whatever the provider returned without checking its type, so a malformed but valid-JSON 200 produced a corrupt or non-string value in the result column instead of falling back to the body. A null `b64_json` became the literal `data:audio/mpeg;base64,None`; a numeric `url` was handed to `_url_to_data_url`; a numeric `text` was written to the cell as a number. Each value is now type-checked before use: `b64_json` must be a non-empty string, `url` must be a string starting with `http` — the guard the sibling `output` branch already applied, `data` must be a list before being indexed, and `text` / `generated_text` must be strings. Anything else falls through to `json.dumps(body)`, which is what the branch already did for unrecognised shapes. Reading `text` and `generated_text` independently also fixes a smaller bug: a null `text` previously masked a valid `generated_text`. Not addressed: a `b64_json` that is a string but not valid base64 still yields an unplayable data URL. Detecting that requires decoding the value on every row, and corrupt-but-well-formed base64 would pass regardless, so the browser's rejection is the same either way. ### Any related issues? Closes #8869 ### How was this PR tested? Written test-first: four tests were added to `AudioTaskCodegenSpec` for the `b64_json`, `url`, `data` and `text` guards, and they fail against the current parse. The suite is at 158 tests, `PythonCodeRawInvalidTextSpec` py-compiles all 117 operators, and `scalafmtCheck` and `scalafix --check` are clean. One existing assertion was updated where it pinned the old indexing form. The generated parser was also run against each malformed shape: every case in the issue now returns the serialized body, valid URL and base64 envelopes still resolve as before, and a null `text` alongside a valid `generated_text` now returns the latter. ### Was this PR authored or co-authored using generative AI tooling? Yes, this PR was co-authored with Claude in compliance with ASF policy. -- 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]
