# pydantic.errors.DictError: value is not a valid dict

- **ID:** `python/pydantic-dict-key-type`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A field typed as Dict[str, int] receives a dict with non-string keys or non-int values, causing validation failure.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 2.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Convert keys to strings: {str(k): v for k, v in data.items()}
   ```
2. **** (85% success)
   ```
   Change type to Dict[str, Any] if flexible
   ```

## Dead Ends

- **** — Key type must be str, integer keys fail. (80% fail)
- **** — Value type must be int, float fails. (70% fail)
