PDGGK commented on PR #37530:
URL: https://github.com/apache/beam/pull/37530#issuecomment-4802404669

   Good point — you're right that we shouldn't skip the warning just because 
the collection's element type is unresolved. For something like 
`ValueState<Set<T>>` the collection's own raw type (`Set`) is fully known, so 
we can still recommend `SetState` even though `T` is a type variable.
   
   I've reworked `warnIfValueStateContainsCollection` to drop the blanket 
`hasUnresolvedParameters()` early-return and match on the raw collection type 
instead. `ValueState<Set<T>>`, `ValueState<List<T>>` and `ValueState<Map<K, 
V>>` now warn as expected (`SetState`, `BagState or OrderedListState`, 
`MapState`). The only remaining no-op case is when the payload is itself a bare 
type variable (e.g. `ValueState<T>`), where there is no raw collection type to 
inspect.
   
   Added unit tests covering the parameterized `Set<T>` and `List<T>` cases 
(asserting the warning fires) and the bare type-variable case (asserting it 
does not). PTAL, thanks!
   


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