annalist
annalist copied to clipboard
If last component does not exist it sometimes return 1 or the up level total
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.
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).