Skip to content

Commit

Permalink
improving logging
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Jan 21, 2025
1 parent 09dbe1b commit 9a6652d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions Common/build_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def determine_graph_version(self, graph_spec: GraphSpec):
for source in graph_spec.sources:
if not source.source_version:
source.source_version = self.source_data_manager.get_latest_source_version(source.id)
self.logger.info(f'Source version - {source.id}: {source.version}')
self.logger.info(f'Using {source.id} version: {source.version}')

# for sub-graphs, if a graph version isn't specified,
# use the graph spec for that subgraph to determine a graph version
Expand All @@ -203,7 +203,7 @@ def determine_graph_version(self, graph_spec: GraphSpec):
subgraph_graph_spec = self.graph_specs.get(subgraph.id, None)
if subgraph_graph_spec:
subgraph.graph_version = self.determine_graph_version(subgraph_graph_spec)
self.logger.info(f'found subgraph version, {graph_spec.graph_id}: {subgraph.graph_version}')
self.logger.info(f'Using subgraph {graph_spec.graph_id} version: {subgraph.graph_version}')
else:
raise GraphSpecError(f'Subgraph {subgraph.id} requested for graph {graph_spec.graph_id} '
f'but the version was not specified and could not be determined without '
Expand All @@ -228,7 +228,6 @@ def determine_graph_version(self, graph_spec: GraphSpec):
self.logger.info(f'Version determined for graph {graph_spec.graph_id}: {graph_version} ({composite_version_string})')
return graph_version


def build_dependencies(self, graph_spec: GraphSpec):
graph_id = graph_spec.graph_id
for subgraph_source in graph_spec.subgraphs:
Expand Down Expand Up @@ -550,10 +549,9 @@ def parse_data_source_spec(self, source_yml):
def get_graph_dir_path(self, graph_id: str, graph_version: str):
return os.path.join(self.graphs_dir, graph_id, graph_version)

def get_graph_output_url(self, graph_id: str, graph_version: str):
graph_output_url = os.environ.get('ORION_OUTPUT_URL', "https://localhost/")
if graph_output_url[-1] != '/':
graph_output_url += '/'
@staticmethod
def get_graph_output_url(graph_id: str, graph_version: str):
graph_output_url = os.environ.get('ORION_OUTPUT_URL', "https://localhost/").removesuffix('/')
return f'{graph_output_url}{graph_id}/{graph_version}/'

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion Common/load_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ def run_qc_and_metadata_stage(self,
normalization_scheme: NormalizationScheme):
# source data QC should go here

self.logger.info(f'Generating release for {source_id}')
source_metadata = self.get_source_metadata(source_id, source_version)
loader = SOURCE_DATA_LOADER_CLASSES[source_id](test_mode=self.test_mode)
source_meta_information = loader.get_source_meta_information()
Expand All @@ -515,6 +514,7 @@ def run_qc_and_metadata_stage(self,
supplementation_version=supplementation_version,
normalization_version=normalization_version,
source_meta_information=source_meta_information)
self.logger.info(f'Generating release version for {source_id}: {release_version}')
return release_version

def get_source_metadata(self, source_id: str, source_version):
Expand Down

0 comments on commit 9a6652d

Please sign in to comment.