File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,21 +181,21 @@ def summarize_path(path: str) -> str:
181181
182182def generate_output_path (input_path : str ) -> str :
183183 """Generates the output path for the graph JSON file."""
184- output_dir = os .getenv ("OUTPUT_DIRECTORY" , "outputs" )
185184
186185
187- match = re .search (r'(?P<base>s3://[^/]+/ )?(?P<project >[^/]+)/(?P<run>run-\d+-\d+)' , input_path )
186+ match = re .search (r'(?P<base>s3://govuk-ai-accelerator-data-integration/ )?(?P<doamin_name >[^/]+)/(?P<run>run-\d+-\d+)' , input_path )
188187
189188 if match :
190189 base = match .group ('base' )
191- project = match .group ('project ' )
190+ doamin_name = match .group ('doamin_name ' )
192191 run_id = match .group ('run' )
193192
194193 if base :
195194 # Dynamically use the same S3 bucket but route to graph_tools prefix
196- return f"{ base } graph_tools/{ project } / { run_id } /graphNode.json"
195+ return f"{ base } graph_tools/{ doamin_name } /output /graphNode.json"
197196
198- return f"{ output_dir } /{ project } /{ run_id } /graphNode.json"
197+ else :
198+ raise ValueError (f"Input path '{ input_path } ' does not contain a recognizable S3 path structure." )
199199
200200 summary = summarize_path (input_path )
201201 raise ValueError (f"Input path '{ summary } ' does not contain a recognizable project/run structure." )
You can’t perform that action at this time.
0 commit comments