Resolve a string class path like 'zarr.AsyncArray' to the actual class.
(class_path: str)
| 4291 | # Each type of indexing ends up calling a different zarr indexing method |
| 4292 | # They all use a method named .getitem, but on a different internal zarr class |
| 4293 | def _resolve_class_from_string(class_path: str) -> type[Any]: |
| 4294 | """Resolve a string class path like 'zarr.AsyncArray' to the actual class.""" |
| 4295 | module_path, class_name = class_path.rsplit(".", 1) |
| 4296 | module = import_module(module_path) |
| 4297 | return getattr(module, class_name) |
| 4298 | |
| 4299 | target_class = _resolve_class_from_string(target_zarr_class) |
| 4300 | method_name = "getitem" |