@@ -878,7 +878,7 @@ async def get_chunk(
878
878
return responses .StreamingResponse (downloader )
879
879
880
880
881
- def make_expr (name : str , expr : str , operands : dict [str , str ], user : db .User , lazy : bool = True ) -> str :
881
+ def make_expr (name : str , expr : str , operands : dict [str , str ], user : db .User , compute : bool = False ) -> str :
882
882
"""
883
883
Create a lazy expression dataset in personal space.
884
884
@@ -938,10 +938,10 @@ def make_expr(name: str, expr: str, operands: dict[str, str], user: db.User, laz
938
938
path = settings .personal / str (user .id )
939
939
path .mkdir (exist_ok = True , parents = True )
940
940
urlpath = f"{ path / name } .b2nd"
941
- if lazy :
942
- arr .save (urlpath = urlpath , mode = "w" )
943
- else :
941
+ if compute :
944
942
arr .compute (urlpath = urlpath , mode = "w" )
943
+ else :
944
+ arr .save (urlpath = urlpath , mode = "w" )
945
945
946
946
return f"@personal/{ name } .b2nd"
947
947
@@ -969,7 +969,7 @@ def error(msg):
969
969
return fastapi .HTTPException (status_code = 400 , detail = msg ) # bad request
970
970
971
971
try :
972
- result_path = make_expr (expr .name , expr .expression , expr .operands , user , expr .lazy )
972
+ result_path = make_expr (expr .name , expr .expression , expr .operands , user , expr .compute )
973
973
except (SyntaxError , ValueError , TypeError ) as exc :
974
974
raise error (f"Invalid name or expression: { exc } " ) from exc
975
975
except KeyError as ke :
@@ -2069,10 +2069,10 @@ async def htmx_command(
2069
2069
2070
2070
elif nargs > 1 and argv [1 ] in {"=" , ":=" }:
2071
2071
operator = argv [1 ]
2072
- lazy = operator == "="
2072
+ compute = operator == ": ="
2073
2073
try :
2074
2074
result_name , expr = command .split (operator , maxsplit = 1 )
2075
- result_path = make_expr (result_name , expr , operands , user , lazy = lazy )
2075
+ result_path = make_expr (result_name , expr , operands , user , compute = compute )
2076
2076
url = make_url (request , "html_home" , path = result_path )
2077
2077
return htmx_redirect (hx_current_url , url )
2078
2078
except SyntaxError :
0 commit comments