Skip to content

Commit

Permalink
Fix type checking with pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Oct 3, 2023
1 parent acb2931 commit 0e2b17a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions qcodes/dataset/exporters/export_to_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,17 @@ def xarray_to_h5netcdf_with_complex_numbers(
message="You are writing invalid netcdf features",
category=UserWarning,
)
# pyright 1.1.329 for some reason pyright does not allow a bool here
# the function is typed to take both True and False in overload
maybe_write_job = internal_ds.to_netcdf(
path=file_path, engine="h5netcdf", invalid_netcdf=True, compute=compute
path=file_path,
engine="h5netcdf",
invalid_netcdf=True,
compute=compute, # pyright: ignore
)
else:
maybe_write_job = internal_ds.to_netcdf(
path=file_path, engine="h5netcdf", compute=compute
path=file_path, engine="h5netcdf", compute=compute # pyright: ignore
)

if not compute and maybe_write_job is not None:
Expand Down

0 comments on commit 0e2b17a

Please sign in to comment.