Skip to content

Commit

Permalink
Add a Literal typing (#8227)
Browse files Browse the repository at this point in the history
* Add a `Literal` typing
  • Loading branch information
max-sixty authored Sep 23, 2023
1 parent 24bf804 commit b14fbd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion xarray/core/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ def apply_ufunc(
dataset_fill_value: object = _NO_FILL_VALUE,
keep_attrs: bool | str | None = None,
kwargs: Mapping | None = None,
dask: str = "forbidden",
dask: Literal["forbidden", "allowed", "parallelized"] = "forbidden",
output_dtypes: Sequence | None = None,
output_sizes: Mapping[Any, int] | None = None,
meta: Any = None,
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ def test_apply_dask() -> None:

# unknown setting for dask array handling
with pytest.raises(ValueError):
apply_ufunc(identity, array, dask="unknown")
apply_ufunc(identity, array, dask="unknown") # type: ignore

def dask_safe_identity(x):
return apply_ufunc(identity, x, dask="allowed")
Expand Down

0 comments on commit b14fbd9

Please sign in to comment.