Skip to content

Commit

Permalink
updates based on pre commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmills-DIT committed Dec 27, 2024
1 parent ef672f2 commit 579f9a8
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions reference_documents/csv_importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ def __init__(self, csv_upload: CSVUpload):

def run(self):
"""
runs the import process
Runs the import process.
Executes the parsing and database population from the provided CSVUpload object
Executes the parsing and database population from the provided CSVUpload
object
"""
if (
not self.csv_upload.preferential_rates_csv_data
Expand Down Expand Up @@ -123,7 +124,7 @@ def find_reference_document_version(
@staticmethod
def verify_area_id_exists(area_id):
"""
Verifies that an area id exists in the database
Verifies that an area id exists in the database.
Args:
area_id: the area id, e.g. 'JP'
Expand All @@ -140,7 +141,7 @@ def verify_area_id_exists(area_id):

def verify_comm_code(self, comm_code):
"""
Verifies that a comm code exists in the database
Verifies that a comm code exists in the database.
Args:
comm_code: the comm code as a string
Expand All @@ -160,7 +161,7 @@ def verify_comm_code(self, comm_code):

def import_preferential_rates_csv_data(self):
"""
Imports preferential rates data from CSV files
Imports preferential rates data from CSV files.
Returns:
None or raises exception
Expand Down Expand Up @@ -226,7 +227,7 @@ def import_preferential_rates_csv_data(self):

def get_or_create_reference_document_version(self, row):
"""
Gets or creates the reference document version based on the CSV row
Gets or creates the reference document version based on the CSV row.
Args:
row: dict, key value pairs of data from the CSV row
Expand Down Expand Up @@ -269,7 +270,7 @@ def get_or_create_reference_document_version(self, row):

def import_order_number_csv_data(self):
"""
Imports order numbers data from CSV files
Imports order numbers data from CSV files.
Returns:
None or raises exception
Expand Down Expand Up @@ -310,7 +311,7 @@ def import_order_number_csv_data(self):

def process_order_number(self, row):
"""
Processes order numbers data from CSV files
Processes order numbers data from CSV files.
Args:
row: dict, key value pairs of data from the CSV row
Expand Down Expand Up @@ -375,7 +376,7 @@ def process_order_number(self, row):

def import_quota_definition_csv_data(self):
"""
Imports quota definition data from CSV files
Imports quota definition data from CSV files.
Returns:
None or raises exception
Expand Down Expand Up @@ -456,10 +457,10 @@ def import_quota_definition_csv_data(self):

def get_dictionary_from_csv_data(self, string):
"""
Returns a dictionary from CSV string
Returns a dictionary from CSV string.
Returns:
dictionary or raises exception
Returns:
dictionary or raises exception
"""
csv_string_io = StringIO(string)
csv_reader = csv.DictReader(csv_string_io)
Expand Down

0 comments on commit 579f9a8

Please sign in to comment.