我正在尝试围绕带有可变数量参数的函数构建API:
%timeit (orig(x))
24.8 ms ± 653 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
%timeit x.where(x.ne(x.shift()) & (x == 1)).ffill(limit=n_hold).fillna(0, downcast='int')
1.36 ms ± 12.7 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
启动API并点击size_t heap_size(){
uint8_t* p = NULL;
size_t size = 0;
while((p = malloc(sizeof(uint8_t))) != NULL)
size++;
return size;
}
时,出现以下错误:
#* @get /get_appl
get_appl <- function(...) {
condition = enquos(...)
df %>%
filter(!!!condition)
}
这与在R中运行http://127.0.0.1/get_appl?x=1
而不是{"error":["500 - Internal server error"],"message":["Error: 'res' ('res = <environment>'), 'req' ('req = <environment>'), 'x' ('x = \"1\"') must not be named, do you need '=='?\n\u001b[90mCall 'rlang::last_error() to see a backtrace\u001b[39m\n"]}
时遇到的错误相同。后一个函数调用在R中应能正常工作,但是当我尝试在http请求get_appl(x = 1)
中使用它时,我收到与以前类似的错误消息。