Skip to content

Commit

Permalink
fg dependency removal
Browse files Browse the repository at this point in the history
  • Loading branch information
zavoraad committed Nov 1, 2024
1 parent 18657d0 commit 182efe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion databricksx12/edi.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def summary(self):
# @returns a python dictionary representing metadata found in EDI/FunctionalGroup/Transaction classes
#
@staticmethod
def class_metadata(cls_obj, exclude=['data', 'raw_data', 'isa']):
def class_metadata(cls_obj, exclude=['data', 'raw_data', 'isa', 'fg']):
return {str(cls_obj.__class__.__name__ + "." + attr): getattr(cls_obj, attr) for attr in dir(cls_obj) if not callable(getattr(cls_obj, attr)) and not attr.startswith("__") and attr not in exclude}

#
Expand Down
9 changes: 5 additions & 4 deletions databricksx12/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ def __init__(self, segments, delim_cls = AnsiX12Delim):
self.data = segments
self.format_cls = delim_cls
self.transaction_type = self._transaction_type()
self.standard_version = self.segments_by_name("GS")[0].element(8)
self.control_number = self.segments_by_name("GS")[0].element(6)
self.date = self.segments_by_name("GS")[0].element(4)
self.time = self.segments_by_name("GS")[0].element(5)
self.fg = (self.segments_by_name("GS")[0] if len(self.segments_by_name("GS")) > 0 else Segment.empty())
self.standard_version = self.fg.element(8)
self.control_number = self.fg.element(6)
self.date = self.fg.element(4)
self.time = self.fg.element(5)
self.sender = self._sender()
self.receiver = self._reciever()

Expand Down

0 comments on commit 182efe2

Please sign in to comment.