Skip to content

[python-types] errors.py: bare dict parameter type on public from_server_error() #241

@realfishsam

Description

@realfishsam

File

sdks/python/pmxt/errors.py

Bare Built-in Types

  • Line 119: def from_server_error(error_data: dict) -> PmxtError: — parameter error_data uses bare dict with no key/value types
    • Should be error_data: Dict[str, Any]

Impact

from_server_error is the public factory function used to convert raw server error responses into typed PmxtError exceptions. It is called internally from client.py and is also importable by users who want to parse error payloads. Bare dict prevents static checkers from narrowing the structure of the argument.

Suggested Fix

def from_server_error(error_data: Dict[str, Any]) -> PmxtError:

Requires from typing import Dict, Any (check existing imports).


Found by automated Python type hints audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions