From 0e47643079b895243e0abb87241e39bf9fa41a21 Mon Sep 17 00:00:00 2001 From: Cloud Cray Date: Fri, 2 Jun 2023 11:21:10 -0400 Subject: [PATCH 1/3] Fix for zero-length string D8 vals --- tigershark/facade/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tigershark/facade/__init__.py b/tigershark/facade/__init__.py index 31ee0be..3f132b8 100644 --- a/tigershark/facade/__init__.py +++ b/tigershark/facade/__init__.py @@ -1295,8 +1295,8 @@ def to_dict(): @staticmethod def x12_to_python(raw): - if raw is None: - return raw + if raw is None or raw == "": + return None if len(raw) >= 8: year, month, day = int(raw[0:4]), int(raw[4:6]), int(raw[6:8]) From 51c0cfbb7fcee7016a36dd7e55a407b792b91063 Mon Sep 17 00:00:00 2001 From: Cloud Cray Date: Fri, 2 Jun 2023 11:25:43 -0400 Subject: [PATCH 2/3] Minor version bump --- tigershark/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tigershark/__init__.py b/tigershark/__init__.py index 57a9bb3..65a9606 100644 --- a/tigershark/__init__.py +++ b/tigershark/__init__.py @@ -2,7 +2,7 @@ TigerShark - An X12 EDI message parser. """ __all__ = ['X12VersionTuple'] -__version__ = "0.3.4" +__version__ = "0.3.5" __authors__ = [ "Steven Buss ", "Steven Lott ", From cf46e924ef3bb0e38aecee15281b4c02889fbf31 Mon Sep 17 00:00:00 2001 From: Cloud Cray Date: Fri, 2 Jun 2023 11:32:43 -0400 Subject: [PATCH 3/3] Minor version bump --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 34e911f..4dec9c0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ TigerShark is an X12 EDI message parser that can be tailored to a specific partner in the health care payment ecosystem. +Version 0.3.5 +------------- + +Minor patch for converting zero-length strings to python values in `D8` elements (dates). +Previous behavior raised a `ValueError` trying to convert `''` to a `datetime.date` - now returns `None`. +This now matches the existing functionality for `DR` elements (datetime values) + + Version 0.3.4 -------------