Skip to content

Commit 9f10efc

Browse files
committed
update upload 2
1 parent 0d7613c commit 9f10efc

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

sdgym/_benchmark/credentials_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
2-
import textwrap
32
import os
3+
import textwrap
44
from tempfile import NamedTemporaryFile
55

66
CREDENTIAL_KEYS = {

sdgym/run_benchmark/upload_benchmark_results.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
'CopulaGAN': 'top center',
3030
'RealTabFormer': 'bottom center',
3131
}
32-
SDGYM_FILE_ID = '1W3tsGOOtbtTw3g0EVE0irLgY_TN_cy2W4ONiZQ57OPo'
32+
MODALITY_TO_FILE_ID = {
33+
'single_table': '1W3tsGOOtbtTw3g0EVE0irLgY_TN_cy2W4ONiZQ57OPo',
34+
'multi_table': '1R13RktVvKnxRecYIge07OBpbX1vbEkE2D1_2idNAKSY',
35+
}
3336
RESULT_FILENAME = 'SDGym Monthly Run.xlsx'
3437

3538

@@ -168,7 +171,7 @@ def upload_results(
168171
f'{run_date}_plot_data': df_to_plot,
169172
}
170173
local_results_writer.write_xlsx(datas, local_file_path)
171-
upload_to_drive((local_file_path), SDGYM_FILE_ID)
174+
upload_to_drive((local_file_path), MODALITY_TO_FILE_ID[modality])
172175
s3_client.upload_file(local_file_path, bucket, s3_key)
173176
write_uploaded_marker(s3_client, bucket, prefix, folder_name, modality=modality)
174177
if temp_dir:

sdgym/run_benchmark/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def post_benchmark_launch_message(date_str, compute_service='AWS', modality='sin
109109
bucket, prefix = parse_s3_path(OUTPUT_DESTINATION_AWS)
110110
url_link = get_s3_console_link(bucket, f'{prefix}{modality}/{folder_name}/')
111111
modality_text = modality.replace('_', '-')
112-
body = f'🏃 SDGym {modality_text} benchmark has been launched on {compute_service}!\n'
112+
body = f'🏃 SDGym {modality_text} benchmark has been launched on {compute_service}! '
113113
body += f'Intermediate results can be found <{url_link}|here>.\n'
114114
post_slack_message(channel, body)
115115

tests/unit/_benchmark/test_credentials_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import json
2-
3-
import pytest
42
import os
53
from pathlib import Path
64
from unittest.mock import patch
75

6+
import pytest
7+
88
from sdgym._benchmark.credentials_utils import (
99
create_credentials_file,
1010
get_credentials,

tests/unit/run_benchmark/test_upload_benchmark_result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from botocore.exceptions import ClientError
88

99
from sdgym.run_benchmark.upload_benchmark_results import (
10-
SDGYM_FILE_ID,
10+
MODALITY_TO_FILE_ID,
1111
get_result_folder_name_and_s3_vars,
1212
main,
1313
upload_already_done,
@@ -208,7 +208,7 @@ def test_upload_results(
208208
)
209209

210210
# Assert
211-
mock_upload_to_drive.assert_called_once_with(local_path, SDGYM_FILE_ID)
211+
mock_upload_to_drive.assert_called_once_with(local_path, MODALITY_TO_FILE_ID['single_table'])
212212
mock_logger.info.assert_called_once_with(
213213
f'Run {run_name} is complete! Proceeding with summarization...'
214214
)

tests/unit/run_benchmark/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_post_benchmark_launch_message(
9494
url = 'https://s3.console.aws.amazon.com/'
9595
mock_get_s3_console_link.return_value = url
9696
expected_body = (
97-
'🏃 SDGym single-table benchmark has been launched on AWS!\n'
97+
'🏃 SDGym single-table benchmark has been launched on AWS! '
9898
f'Intermediate results can be found <{url}|here>.\n'
9999
)
100100
# Run

0 commit comments

Comments
 (0)