Skip to content

Commit

Permalink
fixing some trivial formatting issues, fixing invalid use of exceptio…
Browse files Browse the repository at this point in the history
…n data, making a method static
  • Loading branch information
PhillipsOwen committed Feb 16, 2021
1 parent 2393b60 commit 858a523
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Common/load_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os
import multiprocessing
import argparse

from Common.utils import LoggingUtil
from Common.kgx_file_writer import KGXFileWriter
from Common.kgx_file_normalizer import KGXFileNormalizer, NormalizationBrokenError, NormalizationFailedError
from Common.metadata_manager import MetadataManager as Metadata
from Common.loader_interface import SourceDataBrokenError, SourceDataFailedError
Expand Down Expand Up @@ -143,7 +143,7 @@ def update_source(self, source_id: str):

except SourceDataFailedError as failed_error:
# TODO report these by email or something automated
self.logger.info(f"SourceDataFailedError while updating {source_id}: {broken_error.error_message}")
self.logger.info(f"SourceDataFailedError while updating {source_id}: {failed_error.error_message}")

source_metadata.set_update_error(failed_error.error_message)
source_metadata.set_update_status(Metadata.FAILED)
Expand Down Expand Up @@ -242,7 +242,8 @@ def check_sources_for_annotation(self):
def annotate_source(self, source_id: str):
pass

def get_versioned_file_name(self, source_id: str, source_metadata: dict):
@staticmethod
def get_versioned_file_name(source_id: str, source_metadata: dict):
return f'{source_id}_{source_metadata.get_load_version()}'

def get_source_node_file_path(self, source_id: str, source_metadata: dict):
Expand Down Expand Up @@ -312,7 +313,3 @@ def init_storage_dir(self):
load_manager.update_source(data_source)
load_manager.normalize_source(data_source)
load_manager.annotate_source(data_source)




0 comments on commit 858a523

Please sign in to comment.