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

   ### What changes were proposed in this PR?
   
   **Root cause:** `EncodableInspector.treeHasEncodableString` read annotations 
only from `safeAccessed(sym)`, which hops from an accessor to the field it 
accesses. A trait `val` or `var` has no backing field, so the hop lands on 
`NoSymbol`. The marker stays on the accessor, the argument is classified as a 
plain literal, and `BoundaryValidator` never runs for it.
   
   ```
   trait Labels { @EncodableStringAnnotation val title: String; def snippet = 
pyb"print($title)" }
   
   Before:  PyLiteralStringRenderer  ->  print(hello)
   After:   EncodableStringRenderer  ->  
print(self.decode_python_template('aGVsbG8='))
   ```
   
   The fix checks the accessed symbol **and** the symbol itself. Class `val`s 
(marker on the field) still resolve through the hop. A case-class param 
annotated without `@field` still has the marker on neither, so it stays 
non-Encodable, as the existing test pins. The abstract-class abstract `val` 
shape the issue calls different is not changed here.
   
   ### Any related issues, documentation, discussions?
   
   Closes #8659. First noted in #7862.
   
   ### How was this PR tested?
   
   New `EncodableInspectorSpec` tests. The first three failed before the fix (3 
failed / 33 passed) and pass after:
   
   | Test | Direction |
   | --- | --- |
   | `@EncodableStringAnnotation abstract trait val is Encodable on its 
accessor` | positive |
   | `@EncodableStringAnnotation concrete trait val is Encodable on its 
accessor` | positive |
   | `@EncodableStringAnnotation trait var is Encodable on its accessor` | 
positive |
   | `unannotated trait val is not classified as Encodable` | negative |
   
   ```
   sbt "PyBuilder/test"                       # 193 passed
   sbt "PyBuilder/scalafmtCheckAll" "PyBuilder/Test/scalafmtCheck"
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


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