Skip to content

Commit 45e401c

Browse files
build: update to Rust 1.92 (#1101)
* build: update to Rust 1.92 * update dependencies * pattern update fix
1 parent 38c9377 commit 45e401c

File tree

10 files changed

+1178
-547
lines changed

10 files changed

+1178
-547
lines changed

Cargo.lock

Lines changed: 1115 additions & 474 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,16 @@ actix-files = "0.6"
7171
actix-http = { version = "3.11", features = ["ws"] }
7272
actix-multipart = "0.7"
7373
actix-rt = "2.9"
74-
actix-web = "4.11"
74+
actix-web = "4.12"
7575
actix-web-httpauth = "0.8"
7676
actix-ws = "0.3"
7777
aes-gcm = "0.10.3"
7878
anyhow = "1.0"
7979
approx = "0.5"
80-
arrow = { version = "57.0", features = ["ipc_compression"] }
81-
arrow-array = "57.0"
82-
arrow-ord = "57.0"
83-
arrow-schema = { version = "57.0", features = ["serde"] }
80+
arrow = { version = "57.1", features = ["ipc_compression"] }
81+
arrow-array = "57.1"
82+
arrow-ord = "57.1"
83+
arrow-schema = { version = "57.1", features = ["serde"] }
8484
aruna-rust-api = "2.0.2"
8585
assert_cmd = "2.0"
8686
async-stream = "0.3"
@@ -96,31 +96,31 @@ chrono = { version = "0.4", features = ["serde"] }
9696
clap = { version = "4.5", features = ["derive"] }
9797
clap_derive = "4.5"
9898
config = "0.15"
99-
convert_case = "0.8"
100-
criterion = "0.7"
99+
convert_case = "0.10"
100+
criterion = "0.8"
101101
csv = "1.4"
102102
erased-serde = "0.4"
103103
fallible-iterator = "0.2" # only for postgres-protocol
104104
flexi_logger = { version = "0.31", features = ["trc"] }
105105
float-cmp = "0.10"
106106
futures = "0.3"
107107
futures-util = "0.3"
108-
gdal = "0.18"
109-
gdal-sys = "0.11"
108+
gdal = "0.19"
109+
gdal-sys = "0.12"
110110
# when changing geo version also adapt the Cargo.toml in the expression "deps-workspace"!
111-
geo = "0.31.0"
112-
geo-rand = { git = "https://github.com/lelongg/geo-rand.git", branch = "dependabot/cargo/geo-0.31.0" } # TODO: revert back to "0.5" when it is released
113-
geo-types = "0.7.17" # important for compatibility when linking expressions
111+
geo = "0.32.0"
112+
geo-rand = { git = "https://github.com/lelongg/geo-rand.git", branch = "dependabot/cargo/geo-0.32.0" } # TODO: revert back to "0.5" when it is released
113+
geo-types = "0.7.18" # important for compatibility when linking expressions
114114
geojson = { version = "0.24", features = ["geo-types"] }
115115
httptest = "0.16"
116116
image = "0.25"
117117
indoc = "2.0"
118118
itertools = "0.14"
119-
libloading = "0.8"
119+
libloading = "0.9"
120120
lru = "0.16"
121-
lz4_flex = "0.11"
121+
lz4_flex = "0.12"
122122
mime = "0.3"
123-
ndarray = { version = "0.16", features = ["approx"] } # has to match with `ort`
123+
ndarray = { version = "0.17", features = ["approx"] } # has to match with `ort`
124124
num = "0.4"
125125
num-traits = "0.2"
126126
oauth2 = "5.0"
@@ -132,7 +132,7 @@ opentelemetry = { version = "0.31", default-features = false, features = [
132132
] }
133133
opentelemetry_sdk = { version = "0.31", features = ["rt-tokio"] }
134134
opentelemetry-otlp = { version = "0.31", features = ["grpc-tonic"] }
135-
ort = { version = "2.0.0-rc.10", features = ["ndarray"] }
135+
ort = { version = "2.0.0-rc.11", features = ["ndarray"] }
136136
ouroboros = "0.18"
137137
paste = "1.0"
138138
pbkdf2 = "0.12.2"
@@ -156,7 +156,7 @@ pwhash = "1.0"
156156
quote = "1.0"
157157
rand = "0.9"
158158
rayon = "1.8"
159-
reqwest = { version = "0.12", features = [
159+
reqwest = { version = "0.12", features = [ # must be compatible with `oauth2`
160160
"json",
161161
"multipart",
162162
"stream",
@@ -165,18 +165,18 @@ rustc-hash = { version = "2.1", default-features = false }
165165
serde = { version = "1.0", features = ["derive", "rc"] }
166166
serde_json = "1.0"
167167
serde_urlencoded = "0.7"
168-
serde_with = "3.15"
169-
serial_test = "3.0"
168+
serde_with = "3.16"
169+
serial_test = "3.3"
170170
sha2 = "0.10"
171171
snafu = "0.8"
172-
stac = "0.13"
172+
stac = "0.16"
173173
stream-cancel = "0.8"
174174
strum = { version = "0.27", features = ["derive"] }
175175
strum_macros = "0.27"
176176
syn = { version = "2.0", features = ["full", "extra-traits"] }
177-
tempfile = "3.23"
177+
tempfile = "3.24"
178178
time = "0.3"
179-
tokio = { version = "1.48", features = [
179+
tokio = { version = "1.49", features = [
180180
"fs",
181181
"macros",
182182
"signal",
@@ -198,7 +198,7 @@ tracing-subscriber = { version = "0.3", features = [
198198
"ansi",
199199
"tracing-log",
200200
] }
201-
tracing-appender = "0.2.3"
201+
tracing-appender = "0.2"
202202
typetag = "0.2"
203203
url = { version = "2.5", features = ["serde"] }
204204
utoipa = { version = "5.4", features = [
@@ -219,5 +219,5 @@ vergen = "9.0"
219219
vergen-gitcl = "1.0"
220220
walkdir = "2.4"
221221
wkt = "0.14"
222-
xml = "1.1"
223-
zip = "6.0"
222+
xml = "1.2"
223+
zip = "7.0"

expression/deps-workspace/Cargo.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operators/src/machine_learning/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// lots of structs generated by Snafu for `MachineLearningError` have the suffix "type"
2+
#![allow(clippy::struct_field_names)]
3+
14
use geoengine_datatypes::{
25
machine_learning::MlTensorShape3D,
36
raster::{GridShape2D, RasterDataType},
@@ -13,8 +16,7 @@ pub mod onnx;
1316
pub mod onnx_util;
1417

1518
#[derive(Debug, Snafu)]
16-
#[snafu(visibility(pub(crate)))]
17-
#[snafu(context(suffix(false)), module(error))] // disables default `Snafu` suffix
19+
#[snafu(context(suffix(false)) /* disables default `Snafu` suffix */, module(error), visibility(pub(crate)))]
1820
pub enum MachineLearningError {
1921
#[snafu(display("Error in Onnx model: {}", source))]
2022
Ort { source: ort::Error },

operators/src/machine_learning/onnx.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ where
229229
// TODO: re-use session accross queries?
230230
// TODO: use another method: https://github.com/pykeio/ort/issues/402#issuecomment-2949993914
231231
let mut session = load_onnx_model_from_loading_info(&self.model_loading_info)?;
232-
let input_name = session.inputs[0].name.clone(); // clone input name to avoid mutability problems
232+
let input_name = session.inputs()[0].name().to_string(); // clone input name to avoid mutability problems
233233

234234
let stream = self
235235
.source
@@ -502,7 +502,7 @@ mod tests {
502502
.commit_from_file(test_data!("ml/onnx/test_classification.onnx"))
503503
.unwrap();
504504

505-
let input_name = &session.inputs[0].name.clone();
505+
let input_name = &session.inputs()[0].name().to_string();
506506

507507
let new_samples = arr2(&[[0.1f32, 0.2], [0.2, 0.3], [0.2, 0.2], [0.3, 0.1]]);
508508

@@ -525,7 +525,7 @@ mod tests {
525525
.commit_from_file(test_data!("ml/onnx/test_classification.onnx"))
526526
.unwrap();
527527

528-
let input_name = &session.inputs[0].name.clone();
528+
let input_name = &session.inputs()[0].name().to_string();
529529

530530
let pixels = vec![
531531
vec![0.1f32, 0.2],
@@ -561,7 +561,7 @@ mod tests {
561561
.commit_from_file(test_data!("ml/onnx/test_regression.onnx"))
562562
.unwrap();
563563

564-
let input_name = &session.inputs[0].name.clone();
564+
let input_name = &session.inputs()[0].name().to_string();
565565

566566
let pixels = vec![
567567
vec![0.1f32, 0.1, 0.2],

operators/src/machine_learning/onnx_util.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pub fn check_onnx_model_input_matches_metadata(
147147
metadata_input: MlTensorShape3D,
148148
metadata_input_type: RasterDataType,
149149
) -> Result<(), MachineLearningError> {
150-
let inputs = &session.inputs;
150+
let inputs = &session.inputs();
151151
ensure!(
152152
inputs.len() == 1,
153153
MultipleInputsNotSupported {
@@ -157,12 +157,11 @@ pub fn check_onnx_model_input_matches_metadata(
157157

158158
let input = &inputs[0];
159159

160-
let (Some(input_tensor_type), Some(tensor_shape)) = (
161-
input.input_type.tensor_type(),
162-
input.input_type.tensor_shape(),
163-
) else {
160+
let (Some(input_tensor_type), Some(tensor_shape)) =
161+
(input.dtype().tensor_type(), input.dtype().tensor_shape())
162+
else {
164163
return Err(MachineLearningError::InvalidInputType {
165-
input_type: input.input_type.clone(),
164+
input_type: input.dtype().clone(),
166165
});
167166
};
168167

@@ -203,20 +202,20 @@ pub fn check_onnx_model_output_matches_metadata(
203202
metadata_output: MlTensorShape3D,
204203
metadata_output_type: RasterDataType,
205204
) -> Result<(), MachineLearningError> {
206-
let outputs = &session.outputs;
205+
let outputs = &session.outputs();
207206

208207
// we assume that the first output is the one to use
209208
// TODO: make this configurable?
210209
let output = &outputs[0];
211210
ensure!(
212-
output.output_type.is_tensor(),
211+
output.dtype().is_tensor(),
213212
InvalidOutputType {
214-
output_type: output.output_type.clone()
213+
output_type: output.dtype().clone()
215214
}
216215
);
217216

218217
let dimensions = output
219-
.output_type
218+
.dtype()
220219
.tensor_shape()
221220
.expect("input must be a tensor. checked before!");
222221

@@ -232,7 +231,7 @@ pub fn check_onnx_model_output_matches_metadata(
232231
);
233232

234233
let output_tensor_type = output
235-
.output_type
234+
.dtype()
236235
.tensor_type()
237236
.expect("output must be a tensor. ckecked above!");
238237
let output_raster_type = try_raster_datatype_from_tensor_element_type(output_tensor_type)?;

operators/src/plot/box_plot.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,7 @@ impl PlotQueryProcessor for BoxPlotVectorQueryProcessor {
279279

280280
for accum in &mut accums {
281281
let feature_data = collection.data(&accum.name).expect("checked in param");
282-
let iter = feature_data.float_options_iter().map(|o| match o {
283-
Some(v) => v,
284-
None => f64::NAN,
285-
});
282+
let iter = feature_data.float_options_iter().map(|o| o.unwrap_or(f64::NAN));
286283
accum.update(iter)?;
287284
}
288285
}

operators/src/processing/rasterization/mod.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,30 @@ use crate::engine::{
55
RasterBandDescriptors, RasterOperator, RasterQueryProcessor, RasterResultDescriptor,
66
SingleVectorSource, TypedRasterQueryProcessor, TypedVectorQueryProcessor, WorkflowOperatorPath,
77
};
8-
use arrow::datatypes::ArrowNativeTypeOp;
9-
use geoengine_datatypes::primitives::{CacheHint, ColumnSelection};
10-
118
use crate::error;
129
use crate::processing::rasterization::GridOrDensity::Grid;
1310
use crate::util;
14-
11+
use arrow::datatypes::ArrowNativeTypeOp;
1512
use async_trait::async_trait;
16-
1713
use futures::stream::BoxStream;
1814
use futures::{StreamExt, stream};
1915
use geoengine_datatypes::collections::GeometryCollection;
20-
2116
use geoengine_datatypes::primitives::{
2217
AxisAlignedRectangle, BoundingBox2D, Coordinate2D, RasterQueryRectangle, SpatialPartition2D,
2318
SpatialPartitioned, SpatialResolution, VectorQueryRectangle,
2419
};
20+
use geoengine_datatypes::primitives::{CacheHint, ColumnSelection};
2521
use geoengine_datatypes::raster::{
2622
GeoTransform, Grid2D, GridOrEmpty, GridSize, GridSpaceToLinearSpace, RasterDataType,
2723
RasterTile2D, TilingSpecification,
2824
};
29-
3025
use num_traits::FloatConst;
3126
use rayon::prelude::*;
32-
3327
use serde::{Deserialize, Serialize};
3428
use snafu::ensure;
3529

3630
use crate::util::{spawn_blocking, spawn_blocking_with_thread_pool};
3731

38-
use typetag::serde;
39-
4032
/// An operator that rasterizes vector data
4133
pub type Rasterization = Operator<GridOrDensity, SingleVectorSource>;
4234

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.91.1"
2+
channel = "1.92.0"
33
components = ["cargo", "rustfmt", "rust-src", "clippy", "llvm-tools"]

services/src/api/model/responses/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pub mod ml_models;
33

44
use actix_http::StatusCode;
55
use actix_web::{HttpResponse, dev::ServiceResponse};
6-
use convert_case::{Converter, pattern};
6+
use convert_case::{Converter, Pattern};
77
use serde::{Deserialize, Serialize};
88
use std::fmt;
99
use utoipa::{ToResponse, ToSchema, openapi::schema::SchemaType};
@@ -131,7 +131,7 @@ where
131131
// error variant was not tagged with custom display
132132
// => derive more sensible default than snafu
133133
let conv = Converter::new()
134-
.set_pattern(pattern::sentence)
134+
.set_pattern(Pattern::Sentence)
135135
.set_delim(' ');
136136
message = conv.convert(variant_name);
137137
}

0 commit comments

Comments
 (0)