Skip to content

Commit 13e01db

Browse files
authored
COH-28861 - CI Build - error: Missing type parameters for generic type "ValueManipulator" [type-arg] (#88)
1 parent e603a58 commit 13e01db

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exclude: \w*(_pb2)\w*
88

99
repos:
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.4.0
11+
rev: v4.5.0
1212
hooks:
1313
- id: trailing-whitespace
1414
- id: end-of-file-fixer
@@ -21,12 +21,12 @@ repos:
2121
- id: flake8
2222

2323
- repo: https://github.com/psf/black
24-
rev: 23.7.0
24+
rev: 23.11.0
2525
hooks:
2626
- id: black
2727

2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v1.4.1
29+
rev: v1.7.0
3030
hooks:
3131
- id: mypy
3232

src/coherence/extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,5 +323,5 @@ def identity(cls) -> IdentityExtractor[Any]:
323323

324324

325325
ExtractorExpression: TypeAlias = ValueExtractor[T, E] | str
326-
ManipulatorExpression: TypeAlias = ValueManipulator | str
326+
ManipulatorExpression: TypeAlias = ValueManipulator[T, E] | str
327327
UpdaterExpression: TypeAlias = ValueUpdater[T, R] | str

src/coherence/processor.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class PropertyProcessor(EntryProcessor[R]):
170170
`PropertyProcessor` is a base class for EntryProcessor implementations that depend on a ValueManipulator.
171171
"""
172172

173-
def __init__(self, manipulator: ManipulatorExpression, use_is: bool = False):
173+
def __init__(self, manipulator: ManipulatorExpression[T, E], use_is: bool = False):
174174
"""
175175
Construct a PropertyProcessor for the specified property name.
176176
@@ -182,7 +182,7 @@ def __init__(self, manipulator: ManipulatorExpression, use_is: bool = False):
182182
"""
183183
super().__init__()
184184
if type(manipulator) is str:
185-
self.manipulator: ManipulatorExpression = PropertyManipulator(manipulator, use_is)
185+
self.manipulator: ManipulatorExpression[T, E] = PropertyManipulator(manipulator, use_is)
186186
else:
187187
self.manipulator = manipulator
188188

@@ -222,7 +222,7 @@ class NumberMultiplier(PropertyProcessor[Numeric]):
222222
"""
223223

224224
def __init__(
225-
self, name_or_manipulator: ManipulatorExpression, multiplier: Numeric, post_multiplication: bool = False
225+
self, name_or_manipulator: ManipulatorExpression[T, E], multiplier: Numeric, post_multiplication: bool = False
226226
):
227227
"""
228228
Construct an NumberMultiplier processor that will multiply a property value by a specified factor,
@@ -256,7 +256,9 @@ class NumberIncrementor(PropertyProcessor[Numeric]):
256256
a property value of a numeric type.
257257
"""
258258

259-
def __init__(self, name_or_manipulator: ManipulatorExpression, increment: Numeric, post_increment: bool = False):
259+
def __init__(
260+
self, name_or_manipulator: ManipulatorExpression[T, E], increment: Numeric, post_increment: bool = False
261+
):
260262
"""
261263
Construct an :class:`coherence.processor.NumberIncrementor` processor that will increment a property
262264
value by a specified amount, returning either the old or the new value as specified.
@@ -619,7 +621,7 @@ def extract(extractor: Optional[ExtractorExpression[T, E]] = None) -> EntryProce
619621

620622
@staticmethod
621623
def increment(
622-
name_or_manipulator: ManipulatorExpression, increment: Numeric, post_increment: bool = False
624+
name_or_manipulator: ManipulatorExpression[T, E], increment: Numeric, post_increment: bool = False
623625
) -> EntryProcessor[Numeric]:
624626
"""
625627
Construct an :class:`coherence.processor.NumberIncrementor` processor that will increment a property
@@ -661,7 +663,7 @@ def invoke_mutator(method_name: str, *args: Any) -> EntryProcessor[R]:
661663

662664
@staticmethod
663665
def multiply(
664-
name_or_manipulator: ManipulatorExpression, multiplier: Numeric, post_multiplication: bool = False
666+
name_or_manipulator: ManipulatorExpression[T, E], multiplier: Numeric, post_multiplication: bool = False
665667
) -> EntryProcessor[Numeric]:
666668
"""
667669
Construct an NumberMultiplier processor that will multiply a property value by a specified factor,

0 commit comments

Comments
 (0)