I ran into an interesting call-by-name problem dur...
# development
w
I ran into an interesting call-by-name problem during migration:
Copy code
TypeError: unhashable type: 'Pyright'
I got this after the following migration:
Copy code
coarsened_targets = await Get(
        CoarsenedTargets,
        CoarsenedTargetsRequest(field_set.address for field_set in request.field_sets),
    )
to
Copy code
coarsened_targets = await coarsened_targets_get(
        CoarsenedTargetsRequest(field_set.address for field_set in request.field_sets),
        **implicitly(),
    )
Copy code
Traceback (most recent call last):
  File "/Users/sj/Developer/scratch/oss/pants.git/call-by-name-py-exp/src/python/pants/core/goals/check.py", line 221, in check
    all_results = await MultiGet(
                  ^^^^^^^^^^^^^^^
  File "/Users/sj/Developer/scratch/oss/pants.git/call-by-name-py-exp/src/python/pants/engine/internals/selectors.py", line 356, in MultiGet
    return await _MultiGet(tuple(__arg0))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sj/Developer/scratch/oss/pants.git/call-by-name-py-exp/src/python/pants/engine/internals/selectors.py", line 163, in __await__
    result = yield self.gets
             ^^^^^^^^^^^^^^^
  File "/Users/sj/Developer/scratch/oss/pants.git/call-by-name-py-exp/src/python/pants/backend/python/typecheck/pyright/rules.py", line 308, in pyright_typecheck
    partitions = await pyright_determine_partitions(request, pyright, **implicitly())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sj/Developer/scratch/oss/pants.git/call-by-name-py-exp/src/python/pants/engine/rules.py", line 70, in wrapper
    call = Call(rule_id, output_type, args, *__implicitly)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unhashable type: 'Pyright'
Any reason why a subsystem wouldn't be hashable?
Actually, moreover, it looks like many/most subsytems aren't hashable... This feels like a new problem in migration