Skip to content

Commit

Permalink
Fixed call to try_avg and try_sum.
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime committed Jun 27, 2024
1 parent 6f8fddd commit 8fbdd97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gateway/tests/test_dataframe_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2309,14 +2309,14 @@ def test_try_add(self, numbers_dataframe):

assertDataFrameEqual(outcome, expected)

@pytest.mark.interesting
def test_try_avg(self, numbers_dataframe):
expected = [
Row(a=-0.058571428571428594),
]

with utilizes_valid_plans(numbers_dataframe):
outcome = numbers_dataframe.select(
# TODO -- Also test with the incorrect behavior of select instead of agg.
outcome = numbers_dataframe.agg(
pyspark.sql.functions.try_avg('near_one')).collect()

assertDataFrameEqual(outcome, expected)
Expand Down Expand Up @@ -2372,14 +2372,14 @@ def test_try_subtract(self, numbers_dataframe):

assertDataFrameEqual(outcome, expected)

@pytest.mark.interesting
def test_try_sum(self, numbers_dataframe):
expected = [
Row(a=-0.41000000000000014),
]

with utilizes_valid_plans(numbers_dataframe):
outcome = numbers_dataframe.select(
# TODO -- Also test with the incorrect behavior of select instead of agg.
outcome = numbers_dataframe.agg(
pyspark.sql.functions.try_sum('near_one')).collect()

assertDataFrameEqual(outcome, expected)

0 comments on commit 8fbdd97

Please sign in to comment.