File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed
Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 44FILESYSTEM = "file" if IS_LOCAL_ENV else "s3"
55REGION_NAME = os .getenv ("AWS_REGION" , "us-east-1" )
66COMPANY_ENV = os .getenv ("COMPANY_ENV" , "dev" )
7- BACKEND_ROOT = "/code/backend/ "
7+ BACKEND_ROOT = "/code/"
88BASE_DIR = f"s3://carnot-research-{ COMPANY_ENV } /"
99DATA_DIR = f"s3://carnot-research-{ COMPANY_ENV } /data/"
1010SHARED_DATA_DIR = f"s3://carnot-research-{ COMPANY_ENV } /shared/"
Original file line number Diff line number Diff line change @@ -314,17 +314,12 @@ def run_query_with_capture():
314314
315315 # If we found a filename, check if that file exists and use it
316316 if csv_filename_from_output :
317- actual_csv_path = os . path . join (BACKEND_ROOT , csv_filename_from_output )
318- if os . path . exists (actual_csv_path ) and actual_csv_path != csv_path :
317+ actual_csv_path = Path (BACKEND_ROOT ) / csv_filename_from_output
318+ if actual_csv_path . exists () and actual_csv_path != csv_path :
319319 # Use the file that Carnot created
320320 csv_filename = csv_filename_from_output
321321 csv_path = actual_csv_path
322- df = pd .read_csv (csv_path ) # Re-read from the actual file
323- else :
324- # File doesn't exist, rename our file to match
325- csv_path .rename (actual_csv_path )
326- csv_path = actual_csv_path
327- csv_filename = csv_filename_from_output
322+ df = pd .read_csv (str (csv_path )) # Re-read from the actual file
328323
329324 if df .empty :
330325 message_text = "No results found for your query."
Original file line number Diff line number Diff line change 2424IS_LOCAL_ENV = os .getenv ("LOCAL_ENV" ).lower () == "true"
2525FILESYSTEM = "file" if IS_LOCAL_ENV else "s3"
2626COMPANY_ENV = os .getenv ("COMPANY_ENV" , "dev" )
27- BACKEND_ROOT = "/code/backend/ "
27+ BACKEND_ROOT = "/code/"
2828BASE_DIR = f"s3://carnot-research-{ COMPANY_ENV } /"
2929DATA_DIR = f"s3://carnot-research-{ COMPANY_ENV } /data/"
3030SHARED_DATA_DIR = f"s3://carnot-research-{ COMPANY_ENV } /shared/"
You can’t perform that action at this time.
0 commit comments