Skip to content

Commit

Permalink
Rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
magbak committed Jun 17, 2024
1 parent 730a76d commit a0118e9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lib/chrontext/src/sparql_database/sparql_embedded_oxigraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ impl EmbeddedOxigraph {
let mut reader = BufReader::new(file);
store
.bulk_loader()
.load_from_read(RdfParser::from_format(RdfFormat::NQuads).unchecked(),
&mut reader)
.load_from_read(
RdfParser::from_format(RdfFormat::NQuads).unchecked(),
&mut reader,
)
.map_err(|x| EmbeddedOxigraphError::LoaderError(x.to_string()))?;
if let Some(p) = &config.path {
let mut pb = Path::new(p).to_path_buf();
Expand Down
5 changes: 4 additions & 1 deletion lib/chrontext/src/sparql_database/sparql_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ use super::SparqlQueryable;
use async_trait::async_trait;
use reqwest::header::{ACCEPT, USER_AGENT};
use reqwest::StatusCode;
use sparesults::{FromReadQueryResultsReader, QueryResultsFormat, QueryResultsParseError, QueryResultsParser, QuerySolution};
use sparesults::{
FromReadQueryResultsReader, QueryResultsFormat, QueryResultsParseError, QueryResultsParser,
QuerySolution,
};
use spargebra::Query;
use std::error::Error;
use std::fmt::{Display, Formatter};
Expand Down
12 changes: 9 additions & 3 deletions py_chrontext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ impl Engine {
Ok(())
}

pub fn query(&mut self, py: Python<'_>, sparql: &str, multi_to_strings: Option<bool>) -> PyResult<PyObject> {
pub fn query(
&mut self,
py: Python<'_>,
sparql: &str,
multi_to_strings: Option<bool>,
) -> PyResult<PyObject> {
if self.engine.is_none() {
self.init()?;
}
Expand All @@ -164,7 +169,8 @@ impl Engine {
.block_on(self.engine.as_mut().unwrap().execute_hybrid_query(sparql))
.map_err(|err| PyChrontextError::QueryExecutionError(err))?;

(df, datatypes) = fix_cats_and_multicolumns(df, datatypes, multi_to_strings.unwrap_or(false));
(df, datatypes) =
fix_cats_and_multicolumns(df, datatypes, multi_to_strings.unwrap_or(false));
let pydf = df_to_py_df(df, dtypes_map(datatypes), py)?;
Ok(pydf)
}
Expand All @@ -177,7 +183,7 @@ impl Engine {
builder.enable_all();
let config = Config::default();
let catalog = catalog.to_rust()?;
let res = builder
builder
.build()
.unwrap()
.block_on(start_server(self.engine.take().unwrap(), config, catalog))
Expand Down

0 comments on commit a0118e9

Please sign in to comment.