Skip to content

searchsorted to work with uint type #4235

Closed

Description

@ajpotts

After the Numpy 2.0 transition search_sorted no longer works for uint64 dtype. uint64 was removed from test_searchsorted because it was causing an error:

self = <arkouda.client.ZmqChannel object at 0x7e101ce377e0>
cmd = 'searchSorted<float64,1,1>', recv_binary = False
args = '["{\\"key\\": \\"x1\\", \\"dtype\\": \\"float64\\", \\"val\\": \\"id_cxxDjvW_19\\"}", "{\\"key\\": \\"x2\\", \\"dtype...uint64\\", \\"val\\": \\"id_cxxDjvW_20\\"}", "{\\"key\\": \\"side\\", \\"dtype\\": \\"str\\", \\"val\\": \\"left\\"}"]'
size = 3, request_id = None

    def send_string_message(
        self,
        cmd: str,
        recv_binary: bool = False,
        args: Optional[str] = None,
        size: int = -1,
        request_id: Optional[str] = None,
    ) -> Union[str, memoryview]:
        message = RequestMessage(
            user=username, token=self.token, cmd=cmd, format=MessageFormat.STRING, args=args, size=size
        )
        # Note - Size is a placeholder here because Binary msg not yet support json args and
        # request_id is a noop for now
        logger.debug(f"sending message {json.dumps(message.asdict())}")
    
        self.socket.send_string(json.dumps(message.asdict()))
    
        if recv_binary:
            frame = self.socket.recv(copy=False)
            view = frame.buffer
            # raise errors sent back from the server
            if bytes(view[0 : len(b"Error:")]) == b"Error:":
                raise RuntimeError(frame.bytes.decode())
            return view
        else:
            raw_message = self.socket.recv_string()
            try:
                return_message = ReplyMessage.fromdict(json.loads(raw_message))
    
                # raise errors or warnings sent back from the server
                if return_message.msgType == MessageType.ERROR:
>                   raise RuntimeError(return_message.msg)
E                   RuntimeError: Error executing command: cannot cast class to type - runtime types not compatible

../../arkouda/client.py:532: RuntimeError

Fix this and add uint64 back into test_searchsorted.

Activity

  1. self-assigned this
    on Apr 11, 2025
  2. assigned and unassigned on May 21, 2025
  3. added 2 commits that reference this issue on May 22, 2025
    31b2f96
    10ed544
  4. added a commit that references this issue on May 23, 2025
    6135ac9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions