annalist icon indicating copy to clipboard operation
annalist copied to clipboard

If last component does not exist it sometimes return 1 or the up level total

Open mremond opened this issue 13 years ago • 1 comments

Returns the read/book total:

28> annalist_api_server:counts_with_labels([<<"read">>, <<"book">>, <<"dd">>], day, {2012, 11, 17}, 1). 
[{{2012,11,17},5}]

Returns 1:

31> annalist_api_server:counts_with_labels([<<"read">>, <<"book">>, <<"This key does not exist">>], day, {2012, 11, 17}, 1).
[{{2012,11,17},1}]

Total counts seems accurate:

38> annalist_api_server:counts([<<"read">>, <<"book">>], total).                     
[5]
39> annalist_api_server:counts([<<"read">>, <<"book">>, <<"a">>], total).
[1]
40> annalist_api_server:counts([<<"read">>, <<"book">>, <<"This key does not exist">>], total).
[0]

I think this has to do how uplevel range operator works.

mremond avatar Nov 17 '12 10:11 mremond

I think I found the problem in uplevel. I will create a ticket there in a moment and submit a fix (I need to write tests).

mremond avatar Nov 17 '12 11:11 mremond