Commit c4060211 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

fix(level1): remove extra parameters from write function

parent a0aa764c
Pipeline #11372 canceled with stages
in 0 seconds
......@@ -190,7 +190,7 @@ def update_prc_status(level1_id: str, data_model: str, prc_status: int, batch_id
"""
return request.put(f"/api/level1/prc_status/{level1_id}", {'data_model': data_model, 'prc_status': prc_status, 'batch_id': batch_id})
def write(local_file: Union[IO, str], **extra_kwargs) -> Result:
def write(local_file: Union[IO, str]) -> Result:
'''
将本地的1级数据文件写入到DFS中其他参数如rss_id, cube_id等,可通过extra_kwargs传入
......@@ -202,7 +202,6 @@ def write(local_file: Union[IO, str], **extra_kwargs) -> Result:
Result: 操作的结果对象,包含操作是否成功以及相关的错误信息,成功返回data为1级数据对象
'''
params = {}
params.update(extra_kwargs)
if local_file is None:
raise ValueError("local_file is required")
if isinstance(local_file, str):
......
......@@ -39,20 +39,7 @@ class Level1TestCase(unittest.TestCase):
# with open(file_path, "rb") as file:
# file_path = BytesIO(file.read())
result = level1.write(local_file = file_path,
obs_group="10109100157991",
obs_type="WIDE",
instrument = "MSC",
level0_id="1010910015799127",
level1_id = "1010910015799127",
dag = "csst-msc-l1-mbi",
file_name= "CSST_MSC_MS_WIDE_20230413214557_20230413214827_10100070335_13_L1_V01.fits",
pmapname="csst_000128.pmap",
data_model='csst-msc-l1-mbi',
build=1,
qc_status=10,
dataset='msc-v093',
batch_id="inttest")
result = level1.write(local_file = file_path)
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