From 2e2f7ac8644025788a1025a0fd74467bcd53c3ee Mon Sep 17 00:00:00 2001 From: Tess Hayes Date: Tue, 15 Oct 2024 17:25:27 -0400 Subject: [PATCH] Closes #3842: Fixes mypy CI failures This PR (closes #3842) fixes failures with mypy version 1.12 (released yesterday) --- arkouda/groupbyclass.py | 6 ++++-- arkouda/pdarraycreation.py | 11 +++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arkouda/groupbyclass.py b/arkouda/groupbyclass.py index 57327aa3e..82faf04c5 100644 --- a/arkouda/groupbyclass.py +++ b/arkouda/groupbyclass.py @@ -149,8 +149,10 @@ def unique( else: unique_keys = tuple(a[unique_key_indices] for a in pda) if return_groups: - groups = unique_keys, permutation, segments, nkeys - return *groups, unique_key_indices if return_indices else groups + if return_indices: + return unique_keys, permutation, segments, nkeys, unique_key_indices + else: + return unique_keys, permutation, segments, nkeys else: return unique_keys diff --git a/arkouda/pdarraycreation.py b/arkouda/pdarraycreation.py index 3c5f2cf71..7ef5858c6 100644 --- a/arkouda/pdarraycreation.py +++ b/arkouda/pdarraycreation.py @@ -922,10 +922,13 @@ def arange(*args, **kwargs) -> pdarray: repMsg = generic_msg( cmd="arange", args={"start": start, "stop": stop, "stride": stride, "dtype": arg_dtype} ) - return ( - create_pdarray(repMsg, max_bits=max_bits) - if dtype == akint64 - else array(create_pdarray(repMsg), max_bits=max_bits, dtype=dtype) + return cast( + pdarray, + ( + create_pdarray(repMsg, max_bits=max_bits) + if dtype == akint64 + else array(create_pdarray(repMsg), max_bits=max_bits, dtype=dtype) + ), ) else: raise TypeError(