1515class M2FileParser ():
1616 # Parser version is saved on each file record.
1717 # Increment this version for all updates to parser functionality.
18- parser_version = "3.0 "
18+ parser_version = "3.1 "
1919
2020 chunk_size = 2000 # TODO: determine a good number for this
2121 any_non_whitespace = r'\S'
2222
23- collection = None
2423 activity_date = None
2524
2625 def __init__ (self , event : Metro2Event , filepath : str , collection : str = None ) -> None :
@@ -34,13 +33,12 @@ def __init__(self, event: Metro2Event, filepath: str, collection: str = None) ->
3433 file_name = filepath ,
3534 parsing_status = "In progress" ,
3635 parser_version = self .parser_version ,
36+ # Collection, if present, will be prepended to consumer account number
37+ # for all records in this file
38+ collection = collection ,
3739 )
3840 self .file_record .save ()
3941
40- # Collection, if present, will be prepended to consumer account number
41- # for all records in this file
42- self .collection = collection
43-
4442 def update_file_record (self , status = None , msg = None ) -> None :
4543 """
4644 Update the file record with the given status and error message.
@@ -190,7 +188,7 @@ def parse_line(self, line: str) -> dict:
190188
191189 # parse the base segment into AccountActivity
192190 acct_activity = AccountActivity .parse_from_segment (
193- line , self .file_record , self .activity_date , self . collection )
191+ line , self .file_record , self .activity_date )
194192 parsed ["AccountActivity" ] = acct_activity
195193
196194 # parse the extra segments
0 commit comments