Repository: scverse/scanpy

Issue:
Inconsistent type hinting
### Please make sure these conditions are met

- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest version of scanpy.
- [X] (optional) I have confirmed this bug exists on the master branch of scanpy.

### What happened?

When working on one of the notebooks in `spatialdata-notebooks` I noticed that for `library_id` in `scatterplots.py` the type hints are inconsistent. Specifically here it is indicated to be either `Empty` or `str`:

https://github.com/scverse/scanpy/blob/cd7f6c57d4abb49947fa31a945e9a21b833e6e15/scanpy/plotting/_tools/scatterplots.py#L921

While here the type hint includes `None`:
https://github.com/scverse/scanpy/blob/cd7f6c57d4abb49947fa31a945e9a21b833e6e15/scanpy/plotting/_tools/scatterplots.py#L1287

I think the case should be that None should be included. Very minor, but just noticed it so I thought to open an issue.

### Minimal code sample

```python
NA
```


### Error output

_No response_

### Versions

<details>

```
-----
anndata     0.9.1
scanpy      1.9.3
-----
PIL                 9.5.0
asciitree           NA
cffi                1.15.1
cloudpickle         2.2.1
colorama            0.4.6
cycler              0.10.0
cython_runtime      NA
dask                2023.5.1
dateutil            2.8.2
defusedxml          0.7.1
entrypoints         0.4
fasteners           0.18
h5py                3.8.0
jinja2              3.1.2
joblib              1.2.0
kiwisolver          1.4.4
llvmlite            0.40.0
markupsafe          2.1.3
matplotlib          3.7.1
mpl_toolkits        NA
msgpack             1.0.5
natsort             8.3.1
nt                  NA
numba               0.57.0
numcodecs           0.11.0
numpy               1.24.3
packaging           23.1
pandas              1.5.3
psutil              5.9.5
pyarrow             12.0.0
pyparsing           3.0.9
pythoncom           NA
pytz                2023.3
pywintypes          NA
scipy               1.10.1
session_info        1.0.0
setuptools          67.7.2
six                 1.16.0
sklearn             1.2.2
sphinxcontrib       NA
tblib               1.7.0
threadpoolctl       3.1.0
tlz                 0.12.0
toolz               0.12.0
typing_extensions   NA
win32api            NA
win32com            NA
yaml                6.0
zarr                2.14.2
zipp                NA
zoneinfo            NA
-----
Python 3.10.11 | packaged by conda-forge | (main, May 10 2023, 18:51:25) [MSC v.1934 64 bit (AMD64)]
Windows-10-10.0.22621-SP0

```

</details>



Discussion:

Resolving patch:
diff --git a/scanpy/plotting/_tools/scatterplots.py b/scanpy/plotting/_tools/scatterplots.py
--- a/scanpy/plotting/_tools/scatterplots.py
+++ b/scanpy/plotting/_tools/scatterplots.py
@@ -918,7 +918,7 @@ def spatial(
     basis: str = "spatial",
     img: Union[np.ndarray, None] = None,
     img_key: Union[str, None, Empty] = _empty,
-    library_id: Union[str, Empty] = _empty,
+    library_id: Union[str, None, Empty] = _empty,
     crop_coord: Tuple[int, int, int, int] = None,
     alpha_img: float = 1.0,
     bw: Optional[bool] = False,
@@ -1284,7 +1284,7 @@ def _check_scale_factor(
 
 
 def _check_spatial_data(
-    uns: Mapping, library_id: Union[Empty, None, str]
+    uns: Mapping, library_id: Union[str, None, Empty]
 ) -> Tuple[Optional[str], Optional[Mapping]]:
     """
     Given a mapping, try and extract a library id/ mapping with spatial data.
diff --git a/scanpy/readwrite.py b/scanpy/readwrite.py
--- a/scanpy/readwrite.py
+++ b/scanpy/readwrite.py
@@ -338,7 +338,7 @@ def read_visium(
     genome: Optional[str] = None,
     *,
     count_file: str = "filtered_feature_bc_matrix.h5",
-    library_id: str = None,
+    library_id: Optional[str] = None,
     load_images: Optional[bool] = True,
     source_image_path: Optional[Union[str, Path]] = None,
 ) -> AnnData:


Test patch: