Skip to content

Commit 010a0dd

Browse files
committedDec 12, 2024
Commented out one error log and updated the line number logic
1 parent 8bd089a commit 010a0dd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/file_validator.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ def validate_size_md5(self):
8181
self.from_bucket_name, self.from_prefix = extract_s3_info_from_url(self.file_dir)
8282
self.s3_bucket = S3Bucket()
8383
self.s3_bucket.set_s3_client(self.from_bucket_name, None)
84-
line_num = 2
84+
line_num = 1
8585
for info in self.files_info:
86+
line_num += 1
8687
invalid_reason = ""
8788
file_path = os.path.join(self.file_dir if not self.from_s3 else self.download_file_dir, info[FILE_NAME_DEFAULT])
8889
size = info.get(FILE_SIZE_DEFAULT)
@@ -144,7 +145,7 @@ def validate_size_md5(self):
144145
continue
145146

146147
self.fileList.append({FILE_ID_DEFAULT: file_id, FILE_NAME_DEFAULT: info.get(FILE_NAME_DEFAULT), FILE_PATH: file_path, FILE_SIZE_DEFAULT: file_size, MD5_DEFAULT: md5sum, SUCCEEDED: True, ERRORS: None})
147-
line_num += 1
148+
148149
return True
149150

150151
#public function to read pre-manifest and return list of file records
@@ -210,7 +211,7 @@ def validate_file_id(self, id, line_num):
210211
if self.configs[OMIT_DCF_PREFIX] == False:
211212
msg = f'Line {line_num}: "{id_field_name}": "{id}" is not in correct format. A correct "{id_field_name}" should look like "dg.4DFC/e041576e-3595-5c8b-b0b3-272bc7cb6aa8". You can provide correct "{id_field_name}" or remove the column and let the system generate it for you.'
212213
if not id.startswith("dg.4DFC/"):
213-
self.log.error(msg)
214+
# self.log.error(msg)
214215
return False, msg
215216
else:
216217
uuid = id.split('/')[1]
@@ -220,7 +221,7 @@ def validate_file_id(self, id, line_num):
220221
else:
221222
if(not is_valid_uuid(id)):
222223
msg = f'Line {line_num}: "{id_field_name}": "{id}" is not in correct format. A correct "{id_field_name}" should look like "e041576e-3595-5c8b-b0b3-272bc7cb6aa8". You can provide correct "{id_field_name}" or remove the column and let the system generate it for you.'
223-
self.log.error(msg)
224+
# self.log.error(msg)
224225
return False, msg
225226
else:
226227
if self.has_file_id:

0 commit comments

Comments
 (0)
Please sign in to comment.