Skip to content

Commit dae4814

Browse files
committed
Bump maplib dep
1 parent ecd2b2f commit dae4814

File tree

8 files changed

+85
-29
lines changed

8 files changed

+85
-29
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
jobs = 4
2+
jobs = 8

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ templates = { git = "https://github.com/DataTreehouse/maplib", rev="14f10616cdb4
2525

2626
sparesults = { version = "0.2.3" }
2727
oxrdf = { version = "0.2.2" }
28+
oxrdfio = { version = "0.1.5" }
2829

2930
polars = "0.45.1"
3031
tonic = "0.12.3"
@@ -33,7 +34,7 @@ arrow-flight = "53.1.0"
3334
futures = "0.3.31"
3435
bincode = "1.3.3"
3536
log = "0.4.21"
36-
pyo3 = "0.22.6"
37+
pyo3 = { version="0.22.6", features = ["abi3-py39"] }
3738
reqwest = "0.12.5"
3839
env_logger = "0.11.3"
3940
thiserror = "1.0.58"
@@ -44,17 +45,12 @@ filesize = "0.2.0"
4445
serde = "1.0.203"
4546
serde_json = "1.0.117"
4647
secrecy = "=0.10.3"
47-
backoff = "0.4.0"
48-
gcp-bigquery-client = "0.24.1"
48+
gcp-bigquery-client = "0.25.1"
4949
rayon = "1.10.0"
5050
opcua = {version="0.12.0", features = ["vendored-openssl"]}
5151
url = "2.5.2"
5252
uuid = {version = "1.10.0", features = ["fast-rng", "v4"]}
5353
rustls = "0.23.18"
54-
#Fixing dependabot issues
55-
hashbrown = "0.15.2"
56-
57-
5854

5955
[patch.crates-io]
6056
polars = { git = 'https://github.com/pola-rs/polars', rev="841c387d99d7024037556c4ef79d96bf2caac397" }

lib/bigquery-polars/src/querying.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ fn table_cell_to_any<'a>(
246246
FieldType::Json => {
247247
todo!()
248248
}
249+
FieldType::Interval => {
250+
todo!()
251+
}
249252
}
250253
}
251254

lib/chrontext/src/preparing/graph_patterns/group_pattern.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use crate::constants::GROUPING_COL;
88
use crate::preparing::graph_patterns::GPPrepReturn;
99
use crate::preparing::grouping_col_type;
1010
use oxrdf::Variable;
11-
use polars::prelude::{col, DataFrameJoinOps, IntoLazy, JoinArgs, JoinType, PlSmallStr, Series, UniqueKeepStrategy};
11+
use polars::prelude::{
12+
col, DataFrameJoinOps, IntoLazy, JoinArgs, JoinType, PlSmallStr, Series, UniqueKeepStrategy,
13+
};
1214
use query_processing::find_query_variables::find_all_used_variables_in_aggregate_expression;
1315
use representation::solution_mapping::SolutionMappings;
1416
use spargebra::algebra::{AggregateExpression, GraphPattern};
@@ -112,7 +114,7 @@ impl TimeseriesQueryPrepper {
112114
by_names.as_slice(),
113115
by_names.as_slice(),
114116
JoinArgs::new(JoinType::Inner),
115-
None
117+
None,
116118
)
117119
.unwrap()
118120
.lazy();

lib/chrontext/src/sparql_result_to_polars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub(crate) fn create_static_query_dataframe(
4444
Term::Literal(l) => (
4545
l.datatype().as_str(),
4646
rdf_literal_to_polars_literal_value(l),
47-
)
47+
),
4848
}
4949
} else {
5050
(MULTI_NONE_DT, LiteralValue::Null)

py_chrontext/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "py_chrontext"
3-
version = "0.9.12"
3+
version = "0.9.13"
44
edition = "2021"
55

66
[dependencies]
@@ -22,6 +22,7 @@ tokio.workspace = true
2222
log.workspace = true
2323
env_logger.workspace = true
2424
spargebra.workspace = true
25+
oxrdfio.workspace = true
2526
secrecy.workspace = true
2627

2728
[lib]
@@ -59,4 +60,4 @@ jemallocator = { version = "0.5.4", features = ["disable_initial_exec_tls"] }
5960
opcua = ["chrontext/opcua", "virtualization/opcua"]
6061

6162
[lints.rust]
62-
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("gil-refs", "rdf-star"))'] }
63+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("gil-refs", "rdf-star"))'] }

py_chrontext/src/lib.rs

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ use chrontext::engine::{Engine, EngineConfig};
4040
use flight::client::ChrontextFlightClient;
4141
use flight::server::ChrontextFlightServer;
4242
use log::{debug, info};
43+
use oxrdfio::RdfFormat;
4344
use postgres::catalog::{Catalog, DataProduct};
4445
use postgres::server::{start_server, Config};
4546
use pydf_io::to_python::{df_to_py_df, fix_cats_and_multicolumns};
@@ -149,7 +150,7 @@ impl PyEngine {
149150
#[cfg(not(feature = "opcua"))]
150151
#[new]
151152
#[pyo3(signature = (resources, virtualized_python_database=None, virtualized_bigquery_database=None, sparql_endpoint=None, sparql_embedded_oxigraph=None))]
152-
pub fn new(
153+
pub fn new<'py>(
153154
resources: HashMap<String, PyTemplate>,
154155
virtualized_python_database: Option<VirtualizedPythonDatabase>,
155156
virtualized_bigquery_database: Option<PyVirtualizedBigQueryDatabase>,
@@ -187,14 +188,19 @@ impl PyEngine {
187188
#[cfg(not(feature = "opcua"))]
188189
panic!("Should never happen");
189190
};
190-
let sparql_endpoint = self.sparql_endpoint.clone();
191+
let sparql_endpoint = if let Some(endpoint) = &self.sparql_endpoint {
192+
Some(endpoint.clone())
193+
} else {
194+
None
195+
};
191196

192-
let sparql_oxigraph_config =
193-
self.sparql_embedded_oxigraph
194-
.as_ref()
195-
.map(|store| EmbeddedOxigraph {
196-
store: store.clone(),
197-
});
197+
let sparql_oxigraph_config = if let Some(store) = &self.sparql_embedded_oxigraph {
198+
Some(EmbeddedOxigraph {
199+
store: store.clone(),
200+
})
201+
} else {
202+
None
203+
};
198204

199205
let mut virtualization_map = HashMap::new();
200206
for (k, v) in &self.resources {
@@ -212,7 +218,7 @@ impl PyEngine {
212218
};
213219

214220
self.engine =
215-
Some(Engine::from_config(config).map_err(PyChrontextError::ChrontextError)?);
221+
Some(Engine::from_config(config).map_err(|x| PyChrontextError::ChrontextError(x))?);
216222
}
217223
Ok(())
218224
}
@@ -236,7 +242,7 @@ impl PyEngine {
236242
.build()
237243
.unwrap()
238244
.block_on(self.engine.as_mut().unwrap().query(sparql))
239-
.map_err(PyChrontextError::ChrontextError)
245+
.map_err(|err| PyChrontextError::ChrontextError(err))
240246
})?;
241247

242248
(df, datatypes) =
@@ -283,7 +289,7 @@ impl PyEngine {
283289
.build()
284290
.unwrap()
285291
.block_on(flight_server.serve(address))
286-
.map_err(PyChrontextError::FlightServerError)?;
292+
.map_err(|x| PyChrontextError::FlightServerError(x))?;
287293
Ok(())
288294
})
289295
}
@@ -333,7 +339,7 @@ impl PyFlightClient {
333339
.build()
334340
.unwrap()
335341
.block_on(client.query(&sparql, &self.metadata))
336-
.map_err(PyChrontextError::FlightClientError)?;
342+
.map_err(|x| PyChrontextError::FlightClientError(x))?;
337343
Ok(sm)
338344
});
339345
match res {
@@ -361,6 +367,15 @@ impl PyFlightClient {
361367
}
362368
}
363369

370+
fn resolve_format(format: &str) -> RdfFormat {
371+
match format.to_lowercase().as_str() {
372+
"ntriples" => RdfFormat::NTriples,
373+
"turtle" => RdfFormat::Turtle,
374+
"rdf/xml" | "xml" | "rdfxml" => RdfFormat::RdfXml,
375+
_ => unimplemented!("Unknown format {}", format),
376+
}
377+
}
378+
364379
#[pyclass(name = "VirtualizedBigQueryDatabase")]
365380
#[derive(Clone)]
366381
pub struct PyVirtualizedBigQueryDatabase {
@@ -455,7 +470,7 @@ impl PyDataProduct {
455470
rdf_node_types,
456471
};
457472
rdp.init()
458-
.map_err(PyChrontextError::DataProductQueryParseError)?;
473+
.map_err(|x| PyChrontextError::DataProductQueryParseError(x))?;
459474
Ok(rdp)
460475
}
461476
}

0 commit comments

Comments
 (0)