Commit 0603a95d authored by Wei Shoulin's avatar Wei Shoulin
Browse files

default dataset and batch_id

parent 6fbdae8e
Pipeline #7636 failed with stages
......@@ -184,10 +184,6 @@ def write(local_file: Union[IO | str],
Returns:
Result: 操作的结果对象,包含操作是否成功以及相关的错误信息,成功返回data为1级数据对象
'''
if utils.is_valid_filename(file_name):
raise ValueError(f"Incorrect file name [{file_name}], should be *.*")
params = {
'module_id': module_id,
'level0_id': level0_id,
......@@ -212,8 +208,8 @@ def write(local_file: Union[IO | str],
def generate_prc_msg(module_id: Literal['MSC', 'IFS', 'MCI', 'HSTDM', 'CPIC'],
level1_id: str,
pipeline_id: Optional[str] = '',
dataset: Optional[str] = None,
batch_id: Optional[str] = None) -> Result:
dataset: str = constants.DEFAULT_DATASET,
batch_id: str = constants.DEFAULT_BATCH_ID) -> Result:
"""
生成流水线的处理消息
......@@ -253,8 +249,8 @@ def process_list(level1_id: str) -> Result:
def add_process(level1_id: str,
pipeline_id: str,
run_id: str,
dataset: Optional[str] = None,
batch_id: Optional[str] = None,
dataset: str = constants.DEFAULT_DATASET,
batch_id: str = constants.DEFAULT_BATCH_ID,
prc_time: str = utils.get_current_time(),
prc_status: int = -1024,
prc_module: str = "",
......
......@@ -155,8 +155,8 @@ def write(local_file: Union[IO | str],
file_name: str,
pipeline_id: str,
build: int,
dataset: Optional[str] = None,
batch_id: Optional[str] = None,
dataset: str = constants.DEFAULT_DATASET,
batch_id: str = constants.DEFAULT_BATCH_ID,
**extra_kwargs) -> Result:
"""
将本地的2级数据文件写入到DFS中
......@@ -180,8 +180,7 @@ def write(local_file: Union[IO | str],
Result: 操作的结果对象,包含操作是否成功以及相关的错误信息,成功返回data为2级数据对象
"""
if utils.is_valid_filename(file_name):
raise ValueError(f"Incorrect file name [{file_name}], should be *.*")
params = {
'module_id': module_id,
'level0_id': level0_id,
......
......@@ -31,12 +31,12 @@ class Level0TestCase(unittest.TestCase):
self.assertIsNotNone(result.data, "error message: " + result.message)
def test_update_qc0_status(self):
result = level0.update_qc0_status(level0_id = "1060940003452925", file_type='SCI', qc0_status=1)
result = level0.update_qc0_status(level0_id = "1010910015799127", file_type='SCI', qc0_status=1)
print(result)
self.assertEqual(result.code, 200, "error code: " + str(result.code) + ", message: " + result.message)
def test_update_prc_status(self):
result = level0.update_prc_status(level0_id = "1060940003452925", file_type='SCI', prc_status=3)
result = level0.update_prc_status(level0_id = "1010910015799127", file_type='SCI', prc_status=3)
print(result)
self.assertEqual(result.code, 200, "error code: " + str(result.code) + ", message: " + result.message)
......@@ -59,6 +59,11 @@ class Level0TestCase(unittest.TestCase):
print(result)
self.assertEqual(result.code, 200, "error code: " + str(result.code) + ", message: " + result.message)
def test_add_process(self):
result = level0.add_process(level0_id="1060940003452925", pipeline_id="csst-msc-l1-mbi", run_id="202411071002481234", prc_time="2024-11-07 10:24:12", prc_status=1, prc_module="MSC", message="")
result = level0.add_process(level0_id="1060940003452925",
pipeline_id="csst-msc-l1-mbi",
run_id="202411071002481234",
dataset="v93",
batch_id="v930batch",
prc_time="2024-11-07 10:24:12", prc_status=1, prc_module="MSC", message="")
print(result)
self.assertEqual(result.code, 200, "error code: " + str(result.code) + ", message: " + result.message)
\ No newline at end of file
......@@ -51,8 +51,7 @@ class Level2TestCase(unittest.TestCase):
brick_id = 254,
pipeline_id = "csst-msc-l2-mbi",
build=1,
run_id="20241107100248",
version="094",
dataset="094",
prc_status=1)
print(result)
self.assertEqual(result.code, 200, "error code: " + str(result.code) + ", message: " + result.message)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment