From 0e2b17ad0c811362532d18c9758963c44675be97 Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Tue, 3 Oct 2023 12:21:35 +0200 Subject: [PATCH] Fix type checking with pyright --- qcodes/dataset/exporters/export_to_xarray.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qcodes/dataset/exporters/export_to_xarray.py b/qcodes/dataset/exporters/export_to_xarray.py index dc71b10cfb37..b9df051644d3 100644 --- a/qcodes/dataset/exporters/export_to_xarray.py +++ b/qcodes/dataset/exporters/export_to_xarray.py @@ -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: