From b1381059d7488597486ad50d3daec636b3337a4e Mon Sep 17 00:00:00 2001 From: david-i-berry Date: Wed, 7 Jun 2023 15:28:43 +0200 Subject: [PATCH 1/3] Next bug squash, again missing values. None not detected as missing, now fixed. --- csv2bufr/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csv2bufr/__init__.py b/csv2bufr/__init__.py index 045f171..1810922 100644 --- a/csv2bufr/__init__.py +++ b/csv2bufr/__init__.py @@ -19,7 +19,7 @@ # ############################################################################### -__version__ = '0.6.dev3' +__version__ = '0.6.4' import csv from datetime import timezone, datetime @@ -43,7 +43,7 @@ # some 'constants' SUCCESS = True NUMBERS = (float, int, complex) -MISSING = ("NA", "NaN", "NAN", "None", "") +MISSING = ("NA", "NaN", "NAN", "None", "", None) if 'CSV2BUFR_NULLIFY_INVALID' in os.environ: NULLIFY_INVALID = os.environ['CSV2BUFR_NULLIFY_INVALID'] @@ -173,7 +173,7 @@ def get_(key: str, mapping: dict, data: dict): value = parse_value(element['value'], data) except Exception as e: if NULLIFY_INVALID: - LOGGER.warning(f"Error raised get value for {key}, None returned for {key}") # noqa + LOGGER.warning(f"Warning raised getting value for {key}, None returned for {key}") # noqa value = None else: raise e @@ -598,7 +598,7 @@ def parse(self, data: dict, mappings: dict) -> None: try: value = float(value) except Exception as e: - LOGGER.error("Error converting to expected type") + LOGGER.error(f"Error converting value ({value}) to expected type") raise e # ============== # validate value From df67a92a4baa98ef79ef84dd2c8295c8e0b58abe Mon Sep 17 00:00:00 2001 From: david-i-berry Date: Wed, 7 Jun 2023 15:29:40 +0200 Subject: [PATCH 2/3] Version number corrected. --- csv2bufr/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csv2bufr/__init__.py b/csv2bufr/__init__.py index 1810922..e70538e 100644 --- a/csv2bufr/__init__.py +++ b/csv2bufr/__init__.py @@ -19,7 +19,7 @@ # ############################################################################### -__version__ = '0.6.4' +__version__ = '0.6.3' import csv from datetime import timezone, datetime From c1bd658f66d02ccd255aec46788aa1bc866f5909 Mon Sep 17 00:00:00 2001 From: david-i-berry Date: Wed, 7 Jun 2023 15:47:03 +0200 Subject: [PATCH 3/3] flake8 --- csv2bufr/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csv2bufr/__init__.py b/csv2bufr/__init__.py index e70538e..1e5cb97 100644 --- a/csv2bufr/__init__.py +++ b/csv2bufr/__init__.py @@ -598,7 +598,7 @@ def parse(self, data: dict, mappings: dict) -> None: try: value = float(value) except Exception as e: - LOGGER.error(f"Error converting value ({value}) to expected type") + LOGGER.error(f"Error converting value ({value}) to expected type") # noqa raise e # ============== # validate value