Skip to content

Commit 640a0d1

Browse files
committed
Cast temp to float
1 parent 0b42d25 commit 640a0d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

opensensor/collection_apis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def get_vpd_pipeline(
209209
}
210210
}
211211
},
212+
{"$addFields": {"tempAsFloat": {"$toDouble": "$temp"}}},
212213
{
213214
"$addFields": {
214215
"satvp": {
@@ -217,8 +218,8 @@ def get_vpd_pipeline(
217218
{
218219
"$exp": {
219220
"$multiply": [
220-
{"$divide": [17.27, {"$add": ["$temp", 237.3]}]},
221-
"$temp",
221+
{"$divide": [17.27, {"$add": ["$tempAsFloat", 237.3]}]},
222+
"$tempAsFloat",
222223
]
223224
}
224225
},

0 commit comments

Comments
 (0)