fcbcb3c73892ee31df710fcd6b48d06a3efdc143,src/python/pants/engine/target.py,StringOrStringSequenceField,compute_value,#Any#Any#,744
Before Change
def compute_value(
cls, raw_value: Optional[Union[str, Iterable[str]]], *, address: Address
) -> Optional[Tuple[str, ...]]:
value_or_default = super().compute_value(raw_value, address=address)
if value_or_default is None:
return None
try:
str_list = ensure_str_list(value_or_default, allow_single_str=True)
except ValueError:
raise InvalidFieldTypeException(
address,
cls.alias,
value_or_default,
expected_type=(
"either a single string or an iterable of strings (e.g. a list of strings)"
),
)
return tuple(str_list)
class DictStringToStringField(PrimitiveField, metaclass=ABCMeta):
value: Optional[FrozenDict[str, str]]
After Change
) -> Optional[Tuple[str, ...]]:
if isinstance(raw_value, str):
return (raw_value,)
return super().compute_value(raw_value, address=address)
class DictStringToStringField(PrimitiveField, metaclass=ABCMeta):
value: Optional[FrozenDict[str, str]]
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 15
Instances
Project Name: pantsbuild/pants
Commit Name: fcbcb3c73892ee31df710fcd6b48d06a3efdc143
Time: 2020-04-06
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/engine/target.py
Class Name: StringOrStringSequenceField
Method Name: compute_value
Project Name: pantsbuild/pants
Commit Name: fcbcb3c73892ee31df710fcd6b48d06a3efdc143
Time: 2020-04-06
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/engine/target.py
Class Name: StringOrStringSequenceField
Method Name: compute_value
Project Name: pantsbuild/pants
Commit Name: fcbcb3c73892ee31df710fcd6b48d06a3efdc143
Time: 2020-04-06
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/jvm/rules/targets.py
Class Name: JvmExcludes
Method Name: compute_value
Project Name: pantsbuild/pants
Commit Name: fcbcb3c73892ee31df710fcd6b48d06a3efdc143
Time: 2020-04-06
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/native/rules/targets.py
Class Name: ConanPackages
Method Name: compute_value
Project Name: pantsbuild/pants
Commit Name: fcbcb3c73892ee31df710fcd6b48d06a3efdc143
Time: 2020-04-06
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/engine/target.py
Class Name: StringSequenceField
Method Name: compute_value