TNO Intern

Commit 822cdb96 authored by Arjo Segers's avatar Arjo Segers
Browse files

Improved check on undefined href fields in inquiry listing.

parent 69c32484
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@
# 2023-09, Arjo Segers
#   Fixed bug in definition of listing file dates from rcfile settings.
#
# 2023-11, Arjo Segers
#   Improved check on undefined 'href' fields in inquiry listing.
#
#

########################################################################
@@ -2469,8 +2472,14 @@ class CSO_S5p_Convert(utopya.UtopyaRc):
                    # info ..
                    logging.info("      not present yet, download ...")
                    # check ..
                    if ("href" not in rec.keys()) or numpy.isnan(rec["href"]):
                        logging.error(f"cannot download, no 'href' element in record ...")
                    if "href" not in rec.keys():
                        logging.error(f"cannot download, no 'href' column in inquiry ...")
                        logging.error(f"check inquiry table: {filename}")
                        raise Exception
                    # endif
                    if pandas.isna(rec["href"]):
                        logging.error(f"cannot download, empty 'href' element in inquiry ...")
                        logging.error(f"check inquiry table: {filename}")
                        raise Exception
                    # endif
                    # download ...