Skip to content

COH-28861 - CI Build - error: Missing type parameters for generic type "ValueManipulator" [type-arg] #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exclude: \w*(_pb2)\w*

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -21,12 +21,12 @@ repos:
- id: flake8

- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.11.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
rev: v1.7.0
hooks:
- id: mypy

Expand Down
2 changes: 1 addition & 1 deletion src/coherence/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,5 +323,5 @@ def identity(cls) -> IdentityExtractor[Any]:


ExtractorExpression: TypeAlias = ValueExtractor[T, E] | str
ManipulatorExpression: TypeAlias = ValueManipulator | str
ManipulatorExpression: TypeAlias = ValueManipulator[T, E] | str
UpdaterExpression: TypeAlias = ValueUpdater[T, R] | str
14 changes: 8 additions & 6 deletions src/coherence/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class PropertyProcessor(EntryProcessor[R]):
`PropertyProcessor` is a base class for EntryProcessor implementations that depend on a ValueManipulator.
"""

def __init__(self, manipulator: ManipulatorExpression, use_is: bool = False):
def __init__(self, manipulator: ManipulatorExpression[T, E], use_is: bool = False):
"""
Construct a PropertyProcessor for the specified property name.

Expand All @@ -182,7 +182,7 @@ def __init__(self, manipulator: ManipulatorExpression, use_is: bool = False):
"""
super().__init__()
if type(manipulator) is str:
self.manipulator: ManipulatorExpression = PropertyManipulator(manipulator, use_is)
self.manipulator: ManipulatorExpression[T, E] = PropertyManipulator(manipulator, use_is)
else:
self.manipulator = manipulator

Expand Down Expand Up @@ -222,7 +222,7 @@ class NumberMultiplier(PropertyProcessor[Numeric]):
"""

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

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

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

@staticmethod
def multiply(
name_or_manipulator: ManipulatorExpression, multiplier: Numeric, post_multiplication: bool = False
name_or_manipulator: ManipulatorExpression[T, E], multiplier: Numeric, post_multiplication: bool = False
) -> EntryProcessor[Numeric]:
"""
Construct an NumberMultiplier processor that will multiply a property value by a specified factor,
Expand Down