kz930 opened a new pull request, #6800:
URL: https://github.com/apache/texera/pull/6800

   ### What changes were proposed in this PR?
   
   Fixes a Scala string-interpolation bug in `URLFetcherOpExec`'s fetch-failure 
fallback.
   
   The failure branch built its message with `s"Fetch failed for URL: 
$desc.url"`. In an `s"..."` interpolator, `$desc` expands only the identifier 
`desc` (the `URLFetcherOpDesc` instance) and `.url` is appended as literal 
text. Because `LogicalOp` overrides `toString` with 
`ToStringBuilder.reflectionToString`, the resulting `URL content` cell 
contained the entire descriptor dump instead of the URL:
   
   ```
   Fetch failed for URL: 
org.apache.texera.amber.operator.source.fetcher.URLFetcherOpDesc@5624b9e8[decodingMethod=UTF_8,url=https://this-host-does-not-exist.invalid/x,dummyPropertyList=List(),inputPorts=<null>,operatorId=URLFetcherOpDesc-...,operatorVersion=N/A,outputPorts=<null>].url
   ```
   
   This both malforms the message and leaks internal operator fields 
(`operatorId`, `inputPorts`, `dummyPropertyList`, …) into user-facing output.
   
   The fix wraps the member access in braces so only `desc.url` is interpolated:
   
   ```diff
   -      case None => IOUtils.toInputStream(s"Fetch failed for URL: 
$desc.url", "UTF-8")
   +      case None => IOUtils.toInputStream(s"Fetch failed for URL: 
${desc.url}", "UTF-8")
   ```
   
   Now the message reads as intended:
   
   ```
   Fetch failed for URL: https://this-host-does-not-exist.invalid/x
   ```
   
   ### Any related issues, documentation, discussions?
   
   Closes #6755
   
   ### How was this PR tested?
   
   The failure path is only reached when all retries in 
`URLFetchUtil.getInputStreamFromURL` return `None`. Reproduced by pointing a 
**URL Fetcher** operator at a syntactically valid but unreachable address 
(`https://this-host-does-not-exist.invalid/x`, `.invalid` never resolves so 
`new URL(...)` succeeds but the fetch fails after retries), running, and 
inspecting the `URL content` output cell — before the fix it showed the full 
`URLFetcherOpDesc[...]` dump followed by `.url`; after the fix it shows `Fetch 
failed for URL: https://this-host-does-not-exist.invalid/x`.
   
   No new automated test was added: this is a one-character interpolation fix 
on a rarely-hit fallback string, with no existing `URLFetcherOpExec` unit-test 
harness to extend.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 4.8)
   


-- 
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