Skip to content

Commit 86dad2f

Browse files
committed
fix: handle null Labels
1 parent 153976e commit 86dad2f

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![MBARI](https://www.mbari.org/wp-content/uploads/2014/11/logo-mbari-3b.png)](http://www.mbari.org)
2+
23
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
34
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
45
[![Python](https://img.shields.io/badge/language-Python-blue.svg)](https://www.python.org/downloads/)

src/app/ops/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ async def get_label_counts_json(project_id):
400400
FROM (
401401
SELECT attributes->>'Label' AS label, COUNT(*) AS count
402402
FROM public.main_localization
403-
WHERE attributes ? 'Label' AND project = %s AND attributes->>'verified' = 'true'
403+
WHERE attributes ? 'Label' AND project = %s AND attributes->>'verified' = 'true' AND attributes->>'Label' IS NOT NULL
404404
GROUP BY attributes->>'Label'
405405
) subquery;
406406
"""

test_labels.http

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
# Get labels for a project #DONE
1+
2+
## Get labels for a project ####902004-Planktivore
3+
POST http://127.0.0.1:8002/labels/detail/901103-biodiversity
4+
accept: application/json
5+
Content-Type: application/json
6+
7+
{
8+
"version_name": "megadetrt-mbari-i2map-vits-b-8-20250216-track",
9+
"attribute": "depth"
10+
}
11+
12+
13+
### Get labels for a project ####902004-Planktivore'
14+
GET http://127.0.0.1:8002/labels/902004-Planktivore
15+
accept: application/json
16+
17+
{
18+
"labels": {
19+
"RoboticArm": 1,
20+
"Fish": 1,
21+
"Urchin": 1
22+
}
23+
}
24+
25+
26+
###
27+
28+
29+
# Get labels for a project #i2map
230
GET http://127.0.0.1:8002/labels/i2map
331
accept: application/json
432

0 commit comments

Comments
 (0)