Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src_cpp/py_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static LogicalType pyLogicalType(const py::handle& val) {
auto datetime_datetime = importCache->datetime.datetime();
auto time_delta = importCache->datetime.timedelta();
auto datetime_date = importCache->datetime.date();
auto uuid = importCache->uuid.UUID();
auto uuid_uuid = importCache->uuid.UUID();
auto Decimal = importCache->decimal.Decimal();
if (val.is_none()) {
return LogicalType::ANY();
Expand Down Expand Up @@ -410,7 +410,7 @@ static LogicalType pyLogicalType(const py::handle& val) {
return LogicalType::DATE();
} else if (py::isinstance(val, time_delta)) {
return LogicalType::INTERVAL();
} else if (py::isinstance(val, uuid)) {
} else if (py::isinstance(val, uuid_uuid)) {
return LogicalType::UUID();
} else if (py::isinstance<py::dict>(val)) {
py::dict dict = py::reinterpret_borrow<py::dict>(val);
Expand Down Expand Up @@ -673,8 +673,7 @@ Value PyConnection::transformPythonValueAs(const py::handle& val, const LogicalT
}
case LogicalTypeID::UUID: {
auto strVal = py::str(val).cast<std::string>();
auto uuidVal = UUID::fromString(strVal);
uuid uuidToAppend{uuidVal};
auto uuidToAppend = uuid::fromString(strVal);
return Value{uuidToAppend};
}
case LogicalTypeID::LIST: {
Expand Down
9 changes: 4 additions & 5 deletions src_cpp/py_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PythonObjectType getPythonObjectType(py::handle& ele) {
auto pyDateTime = importCache->datetime.datetime();
auto pandasNat = importCache->pandas.NaT();
auto pyDate = importCache->datetime.date();
auto uuid = importCache->uuid.UUID();
auto pyUuid = importCache->uuid.UUID();
if (ele.is_none() || ele.is(pandasNa) || ele.is(pandasNat)) {
return PythonObjectType::None;
} else if (py::isinstance<py::bool_>(ele)) {
Expand All @@ -37,7 +37,7 @@ PythonObjectType getPythonObjectType(py::handle& ele) {
return PythonObjectType::Bytes;
} else if (py::isinstance<py::list>(ele)) {
return PythonObjectType::List;
} else if (py::isinstance(ele, uuid)) {
} else if (py::isinstance(ele, pyUuid)) {
return PythonObjectType::UUID;
} else if (py::isinstance<py::dict>(ele)) {
return PythonObjectType::Dict;
Expand Down Expand Up @@ -189,9 +189,8 @@ void transformPythonValue(common::ValueVector* outputVector, uint64_t pos, py::h
} break;
case PythonObjectType::UUID: {
outputVector->setNull(pos, false /* isNull */);
int128_t result = 0;
UUID::fromString(ele.attr("hex").cast<std::string>(), result);
outputVector->setValue(pos, result);
uuid result = uuid::fromString(ele.attr("hex").cast<std::string>());
outputVector->setValue(pos, result.value);
} break;
case PythonObjectType::Dict: {
PyDictionary dict = PyDictionary(py::reinterpret_borrow<py::object>(ele));
Expand Down
2 changes: 1 addition & 1 deletion src_cpp/py_query_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ py::object PyQueryResult::convertValueToPyObject(const Value& value) {
}
case LogicalTypeID::UUID: {
lbug::common::int128_t result = value.getValue<lbug::common::int128_t>();
std::string uuidString = lbug::common::UUID::toString(result);
std::string uuidString = lbug::common::uuid::toString(result);
auto UUID = importCache->uuid.UUID();
return UUID(uuidString);
}
Expand Down
Loading