66#include " common/constants.h"
77#include " common/exception/not_implemented.h"
88#include " common/exception/runtime.h"
9- #include " common/string_format.h"
109#include " common/types/uuid.h"
1110#include " common/utils.h"
1211#include " datetime.h" // from Python
1716#include " pandas/pandas_scan.h"
1817#include " processor/result/factorized_table.h"
1918#include " pyarrow/pyarrow_scan.h"
19+ #include < format>
2020
2121using namespace lbug ::common;
2222using namespace lbug ;
@@ -203,10 +203,10 @@ void PyConnection::getAllEdgesForTorchGeometric(py::array_t<int64_t>& npArray,
203203 // Set the number of threads to 1 for fetching edges to ensure ordering.
204204 auto numThreadsForExec = conn->getMaxNumThreadForExec ();
205205 conn->setMaxNumThreadForExec (1 );
206- // Run queries in batch to fetch edges.
207- auto queryString = " MATCH (a:{})-[:{}]->(b:{}) WHERE offset(id(b)) >= $s AND offset(id(b)) < "
208- " $e RETURN offset(id(a)), offset(id(b))" ;
209- auto query = stringFormat (queryString, srcTableName, relName, dstTableName);
206+ auto query =
207+ std::format ( " MATCH (a:{})-[:{}]->(b:{}) WHERE offset(id(b)) >= $s AND offset(id(b)) < "
208+ " $e RETURN offset(id(a)), offset(id(b))" ,
209+ srcTableName, relName, dstTableName);
210210 auto preparedStatement = conn->prepare (query);
211211 auto srcBuffer = buffer;
212212 auto dstBuffer = buffer + numRels;
@@ -378,8 +378,8 @@ static LogicalType pyLogicalType(const py::handle& val) {
378378 }
379379 if (precision > common::DECIMAL_PRECISION_LIMIT) {
380380 throw common::NotImplementedException (
381- stringFormat (" Decimal precision cannot be greater than {}"
382- " Note: positive exponents contribute to precision" ,
381+ std::format (" Decimal precision cannot be greater than {}"
382+ " Note: positive exponents contribute to precision" ,
383383 common::DECIMAL_PRECISION_LIMIT));
384384 }
385385 return LogicalType::DECIMAL (precision, -exponent);
@@ -403,13 +403,13 @@ static LogicalType pyLogicalType(const py::handle& val) {
403403 curChildValueType = pyLogicalType (child.second );
404404 LogicalType resultKey, resultValue;
405405 if (!LogicalTypeUtils::tryGetMaxLogicalType (childKeyType, curChildKeyType, resultKey)) {
406- throw RuntimeException (stringFormat (
406+ throw RuntimeException (std::format (
407407 " Cannot convert Python object to Lbug value : {} is incompatible with {}" ,
408408 childKeyType.toString (), curChildKeyType.toString ()));
409409 }
410410 if (!LogicalTypeUtils::tryGetMaxLogicalType (childValueType, curChildValueType,
411411 resultValue)) {
412- throw RuntimeException (stringFormat (
412+ throw RuntimeException (std::format (
413413 " Cannot convert Python object to Lbug value : {} is incompatible with {}" ,
414414 childValueType.toString (), curChildValueType.toString ()));
415415 }
@@ -424,7 +424,7 @@ static LogicalType pyLogicalType(const py::handle& val) {
424424 auto curChildType = pyLogicalType (child);
425425 LogicalType result;
426426 if (!LogicalTypeUtils::tryGetMaxLogicalType (childType, curChildType, result)) {
427- throw RuntimeException (stringFormat (
427+ throw RuntimeException (std::format (
428428 " Cannot convert Python object to Lbug value : {} is incompatible with {}" ,
429429 childType.toString (), curChildType.toString ()));
430430 }
@@ -520,7 +520,7 @@ static LogicalType pyLogicalTypeFromParameter(const py::handle& val) {
520520 auto curChildType = pyLogicalTypeFromParameter (child);
521521 LogicalType result;
522522 if (!LogicalTypeUtils::tryGetMaxLogicalType (childType, curChildType, result)) {
523- throw RuntimeException (stringFormat (
523+ throw RuntimeException (std::format (
524524 " Cannot convert Python object to Lbug value : {} is incompatible with {}" ,
525525 childType.toString (), curChildType.toString ()));
526526 }
0 commit comments