|
@@ -17,6 +17,7 @@ from alibabacloud_paiflow20210202.client import Client as PAIFlow20210202Client
|
|
from datetime import datetime, timedelta
|
|
from datetime import datetime, timedelta
|
|
from odps import ODPS
|
|
from odps import ODPS
|
|
from ad_monitor_util import _monitor
|
|
from ad_monitor_util import _monitor
|
|
|
|
+import re
|
|
|
|
|
|
target_names = {
|
|
target_names = {
|
|
'样本shuffle',
|
|
'样本shuffle',
|
|
@@ -153,17 +154,10 @@ def get_train_data_list(date_begin):
|
|
def update_data_date_range(old_str, date_begin='20250320'):
|
|
def update_data_date_range(old_str, date_begin='20250320'):
|
|
date_list = get_train_data_list(date_begin)
|
|
date_list = get_train_data_list(date_begin)
|
|
train_list = ["'" + item + "'" for item in date_list]
|
|
train_list = ["'" + item + "'" for item in date_list]
|
|
- result = ','.join(train_list)
|
|
|
|
- start_index = old_str.find('where dt in (')
|
|
|
|
- if start_index != -1:
|
|
|
|
- equal_sign_index = start_index + len('where dt in (')
|
|
|
|
- # 找到下一个双引号的位置
|
|
|
|
- next_quote_index = old_str.find(')', equal_sign_index)
|
|
|
|
- if next_quote_index != -1:
|
|
|
|
- # 进行替换
|
|
|
|
- new_value = old_str[:equal_sign_index] + result + old_str[next_quote_index:]
|
|
|
|
- return new_value
|
|
|
|
- return None
|
|
|
|
|
|
+ result = f"in ({','.join(train_list)})"
|
|
|
|
+ pattern = r"in\s*\(\s*'[^']+'\s*(?:,\s*'[^']+'\s*)*\)"
|
|
|
|
+ new_value = re.sub(pattern, result, old_str, flags=re.IGNORECASE)
|
|
|
|
+ return new_value
|
|
|
|
|
|
|
|
|
|
def compare_timestamp_with_today_start(time_str):
|
|
def compare_timestamp_with_today_start(time_str):
|