Skip to content

Commit

Permalink
Merge pull request #109 from wmo-im/debug_missing_values
Browse files Browse the repository at this point in the history
Debug missing values
  • Loading branch information
david-i-berry authored Jun 7, 2023
2 parents 276677a + c1bd658 commit 61ce5a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions csv2bufr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
###############################################################################

__version__ = '0.6.dev3'
__version__ = '0.6.3'

import csv
from datetime import timezone, datetime
Expand All @@ -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']
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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") # noqa
raise e
# ==============
# validate value
Expand Down

0 comments on commit 61ce5a6

Please sign in to comment.