Skip to content

Commit

Permalink
Remove duplicate type hints (#534)
Browse files Browse the repository at this point in the history
* Remove duplicate type hints

Formerly, we had type hints in the docstrings, but after
introducing the actual type hints, they are not needed anymore.

This PR removes those duplicate type hints in the docstrings from
the public APIs.

* remove some leftover duplicate type hints
  • Loading branch information
mdumandag committed Mar 14, 2022
1 parent eaece2e commit 497694c
Show file tree
Hide file tree
Showing 40 changed files with 1,068 additions and 1,311 deletions.
76 changes: 32 additions & 44 deletions hazelcast/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ def count(attribute_path: str = None) -> Aggregator[int]:
Accepts ``None`` input values and ``None`` extracted values.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[int]: An aggregator that counts the input values.
An aggregator that counts the input values.
"""
return _CountAggregator(attribute_path)

Expand All @@ -197,11 +197,10 @@ def distinct(attribute_path: str = None) -> Aggregator[typing.Set[AggregatorResu
Accepts ``None`` input values and ``None`` extracted values.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[set]: An aggregator that calculates the distinct set of
input values.
An aggregator that calculates the distinct set of input values.
"""
return _DistinctValuesAggregator(attribute_path)

Expand All @@ -218,11 +217,10 @@ def double_avg(attribute_path: str = None) -> Aggregator[float]:
unless they are out of range for ``double`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[float]: An aggregator that calculates the average of
the input values.
An aggregator that calculates the average of the input values.
"""
return _DoubleAverageAggregator(attribute_path)

Expand All @@ -239,11 +237,10 @@ def double_sum(attribute_path: str = None) -> Aggregator[float]:
unless they are out of range for ``double`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[float]: An aggregator that calculates the sum of the input
values.
An aggregator that calculates the sum of the input values.
"""
return _DoubleSumAggregator(attribute_path)

Expand All @@ -258,11 +255,10 @@ def fixed_point_sum(attribute_path: str = None) -> Aggregator[int]:
client unless they are out of range for ``long`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[int]: An aggregator that calculates the sum of the
input values.
An aggregator that calculates the sum of the input values.
"""
return _FixedPointSumAggregator(attribute_path)

Expand All @@ -277,11 +273,10 @@ def floating_point_sum(attribute_path: str = None) -> Aggregator[float]:
client unless they are out of range for ``double`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[float]: An aggregator that calculates the sum of the
input values.
An aggregator that calculates the sum of the input values.
"""
return _FloatingPointSumAggregator(attribute_path)

Expand All @@ -298,11 +293,10 @@ def int_avg(attribute_path: str = None) -> Aggregator[int]:
are out of range for ``int`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[int]: An aggregator that calculates the average of the
input values.
An aggregator that calculates the average of the input values.
"""
return _IntegerAverageAggregator(attribute_path)

Expand All @@ -319,11 +313,10 @@ def int_sum(attribute_path: str = None) -> Aggregator[int]:
are out of range for ``int`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[int]: An aggregator that calculates the sum of the
input values.
An aggregator that calculates the sum of the input values.
"""
return _IntegerSumAggregator(attribute_path)

Expand All @@ -340,11 +333,10 @@ def long_avg(attribute_path: str = None) -> Aggregator[int]:
are out of range for ``long`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[int]: An aggregator that calculates the average of the
input values.
An aggregator that calculates the average of the input values.
"""
return _LongAverageAggregator(attribute_path)

Expand All @@ -361,11 +353,10 @@ def long_sum(attribute_path: str = None) -> Aggregator[int]:
are out of range for ``long`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[int]: An aggregator that calculates the sum of the
input values.
An aggregator that calculates the sum of the input values.
"""
return _LongSumAggregator(attribute_path)

Expand All @@ -382,11 +373,10 @@ def max_(attribute_path: str = None) -> Aggregator[AggregatorResultType]:
equivalents of types like ``int``, ``str``, and ``float``.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[any]: An aggregator that calculates the max of the input
values.
An aggregator that calculates the max of the input values.
"""
return _MaxAggregator(attribute_path)

Expand All @@ -403,11 +393,10 @@ def min_(attribute_path: str = None) -> Aggregator[AggregatorResultType]:
equivalents of types like ``int``, ``str``, and ``float``.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[any]: An aggregator that calculates the min of the
input values.
An aggregator that calculates the min of the input values.
"""
return _MinAggregator(attribute_path)

Expand All @@ -422,11 +411,10 @@ def number_avg(attribute_path: str = None) -> Aggregator[float]:
client unless they are out of range for ``double`` type in Java.
Args:
attribute_path (str): Extracts values from this path, if given.
attribute_path: Extracts values from this path, if given.
Returns:
Aggregator[float]: An aggregator that calculates the average of
the input values.
An aggregator that calculates the average of the input values.
"""
return _NumberAverageAggregator(attribute_path)

Expand All @@ -446,11 +434,11 @@ def max_by(attribute_path: str) -> Aggregator[MapEntry[KeyType, ValueType]]:
equivalents of types like ``int``, ``str``, and ``float``.
Args:
attribute_path (str): Path to extract values from.
attribute_path: Path to extract values from.
Returns:
Aggregator[MapEntry]: An aggregator that calculates the input value
containing the maximum value extracted from the path.
An aggregator that calculates the input value containing the maximum
value extracted from the path.
"""
return _MaxByAggregator(attribute_path)

Expand All @@ -470,10 +458,10 @@ def min_by(attribute_path: str) -> Aggregator[MapEntry[KeyType, ValueType]]:
equivalents of types like ``int``, ``str``, and ``float``.
Args:
attribute_path (str): Path to extract values from.
attribute_path: Path to extract values from.
Returns:
Aggregator[MapEntry]: An aggregator that calculates the input value
containing the minimum value extracted from the path.
An aggregator that calculates the input value containing the minimum
value extracted from the path.
"""
return _MinByAggregator(attribute_path)

0 comments on commit 497694c

Please sign in to comment.