We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f7bf4c commit 61318d9Copy full SHA for 61318d9
src/serializers/type_serializers/uuid.rs
@@ -1,7 +1,8 @@
1
use std::borrow::Cow;
2
3
-use pyo3::prelude::*;
4
use pyo3::types::PyDict;
+use pyo3::{intern, prelude::*};
5
+use uuid::Uuid;
6
7
use crate::definitions::DefinitionsBuilder;
8
@@ -11,7 +12,10 @@ use super::{
11
12
};
13
14
pub(crate) fn uuid_to_string(py_uuid: &Bound<'_, PyAny>) -> PyResult<String> {
- Ok(py_uuid.str()?.to_string())
15
+ let py = py_uuid.py();
16
+ let uuid_int_val: u128 = py_uuid.getattr(intern!(py, "int"))?.extract()?;
17
+ let uuid = Uuid::from_u128(uuid_int_val);
18
+ Ok(uuid.to_string())
19
}
20
21
#[derive(Debug, Clone)]
0 commit comments