<@UB2J9BQA0> would we be interested in moving the ...
# development
a
@hundreds-father-404 would we be interested in moving the
.expect_single()
method into
Collection
instead of into
Targets
?
h
Possibly, but it’s important the error message doesn’t change for Targets so I’m not sure how clean it would be to generalize
a
we could just override it in the subclass maybe
h
That might work. Do you have a particular use case for needing the method elsewhere or this is more general refactoring?
a
i was just wondering why we chose to require collections for
Addresses
->
Targets
where it seems like everywhere else we just use a
MultiGet
oh ok, it's because we get transitive deps. i'd still like to specialize the case when we only want to request a single target but maybe the idea is that we don't want to allow that. i suppose i can request something less general than
Targets
to get what i want
h
You can request a WrappedTarget, given some Address. The wrapper is necessary to work with the engine using exact types But from a goal rule, that won’t work because the user can specify multiple targets. We used to allow you to request in a goal rule one single target, and it made the graph really difficult to work with. Stu and Greg proposed converting it into a method on the collection class