Commit 6e98a798 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

add qc status in write

parent 088dca3f
......@@ -163,6 +163,7 @@ def write(local_file: Union[IO, str],
level0_id: Optional[str] = None,
dataset: str = constants.DEFAULT_DATASET,
batch_id: str = constants.DEFAULT_BATCH_ID,
qc1_status: int = 0,
**extra_kwargs) -> Result:
'''
将本地的1级数据文件写入到DFS中其他参数如rss_id, cube_id等,可通过extra_kwargs传入
......@@ -179,6 +180,7 @@ def write(local_file: Union[IO, str],
build (int): 构建号
dataset (str): 数据集名称
batch_id (str): 批次ID
qc1_status (int): QC1状态
**kwargs: 额外的关键字参数,这些参数将传递给DFS
Returns:
......@@ -194,7 +196,8 @@ def write(local_file: Union[IO, str],
'pmapname': pmapname,
'build': build,
'dataset': dataset,
'batch_id': batch_id
'batch_id': batch_id,
'qc1_status': qc1_status
}
if not dataset or not batch_id:
raise ValueError("dataset and batch_id is required")
......
......@@ -157,6 +157,7 @@ def write(local_file: Union[IO, str],
brick_id: Optional[int] = 0,
dataset: str = constants.DEFAULT_DATASET,
batch_id: str = constants.DEFAULT_BATCH_ID,
qc2_status: int = 0,
**extra_kwargs) -> Result:
"""
将本地的2级数据文件写入到DFS中
......@@ -174,6 +175,7 @@ def write(local_file: Union[IO, str],
brick_id (Optional[int]): 天区的ID默认为 0
dataset (Optional[str], optional): 数据集名称. Defaults to None.
batch_id (Optional[str], optional): 最后一次成功的批次ID. Defaults to None.
qc2_status (int): QC0状态默认为 0
**kwargs: 额外的关键字参数,这些参数将传递给DFS
Returns:
......@@ -192,7 +194,8 @@ def write(local_file: Union[IO, str],
'pipeline_id': pipeline_id,
'build': build,
'dataset': dataset,
'batch_id': batch_id
'batch_id': batch_id,
'qc2_status': qc2_status
}
params.update(extra_kwargs)
if local_file is None:
......
......@@ -48,7 +48,8 @@ class Level1TestCase(unittest.TestCase):
pmapname="csst_000128.pmap",
file_type='SCI',
build=1,
prc_status=1)
qc1_status=10,
prc_status=12)
print(result)
self.assertEqual(result.code, 200, "error code: " + str(result.code) + ", message: " + result.message)
......
......@@ -49,6 +49,7 @@ class Level2TestCase(unittest.TestCase):
data_type='csst-msc-l2-mbi-cat',
file_name = "CSST_MSC_MS_SCI_20310423084104_20310423084334_10109400638867_12_L2_V01_CATMIX.fits",
brick_id = 254,
qc2_status=12,
pipeline_id = "csst-msc-l2-mbi",
build=1,
dataset="094",
......
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