Skip to content

Commit b9ee75e

Browse files
authored
Merge pull request #86 from pbs-data-solutions/dependabot/cargo/pyo3-0.23.1
Bump pyo3 from 0.22.6 to 0.23.1
2 parents 917ddcf + 54e655d commit b9ee75e

File tree

7 files changed

+38
-38
lines changed

7 files changed

+38
-38
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ python = ["dep:pyo3"]
1616

1717
[dependencies]
1818
chrono = { version = "0.4.38", features = ["serde"] }
19-
pyo3 = { version = "0.22.6", optional = true }
19+
pyo3 = { version = "0.23.1", optional = true }
2020
serde = { version = "1.0.215", features = ["derive"] }
2121
serde-xml-rs = "0.6.0"
2222
serde_json = "1.0.132"

src/native/common.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl Value {
8181
}
8282

8383
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
84-
let dict = PyDict::new_bound(py);
84+
let dict = PyDict::new(py);
8585
dict.set_item("by", &self.by)?;
8686
dict.set_item("by_unique_id", &self.by_unique_id)?;
8787
dict.set_item("role", &self.role)?;
@@ -160,7 +160,7 @@ impl Reason {
160160
}
161161

162162
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
163-
let dict = PyDict::new_bound(py);
163+
let dict = PyDict::new(py);
164164
dict.set_item("by", &self.by)?;
165165
dict.set_item("by_unique_id", &self.by_unique_id)?;
166166
dict.set_item("role", &self.role)?;
@@ -211,7 +211,7 @@ impl Entry {
211211
}
212212

213213
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
214-
let dict = PyDict::new_bound(py);
214+
let dict = PyDict::new(py);
215215
dict.set_item("entry_id", &self.entry_id)?;
216216
if let Some(value) = &self.value {
217217
dict.set_item("value", value.to_dict(py)?)?;
@@ -261,7 +261,7 @@ impl Comment {
261261
}
262262

263263
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
264-
let dict = PyDict::new_bound(py);
264+
let dict = PyDict::new(py);
265265
dict.set_item("comment_id", &self.comment_id)?;
266266
if let Some(value) = &self.value {
267267
dict.set_item("value", value.to_dict(py)?)?;
@@ -369,7 +369,7 @@ impl Field {
369369
}
370370

371371
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
372-
let dict = PyDict::new_bound(py);
372+
let dict = PyDict::new(py);
373373
dict.set_item("name", &self.name)?;
374374
dict.set_item("field_type", &self.field_type)?;
375375
dict.set_item("data_type", &self.data_type)?;
@@ -381,7 +381,7 @@ impl Field {
381381
if let Some(entries) = &self.entries {
382382
for entry in entries {
383383
let entry_dict = entry.to_dict(py)?;
384-
entry_dicts.push(entry_dict.to_object(py));
384+
entry_dicts.push(entry_dict);
385385
}
386386
dict.set_item("entries", entry_dicts)?;
387387
} else {
@@ -392,7 +392,7 @@ impl Field {
392392
if let Some(comments) = &self.comments {
393393
for comment in comments {
394394
let comment_dict = comment.to_dict(py)?;
395-
comment_dicts.push(comment_dict.to_object(py));
395+
comment_dicts.push(comment_dict);
396396
}
397397
dict.set_item("comments", comment_dicts)?;
398398
} else {
@@ -458,7 +458,7 @@ impl Category {
458458
}
459459

460460
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
461-
let dict = PyDict::new_bound(py);
461+
let dict = PyDict::new(py);
462462
dict.set_item("name", &self.name)?;
463463
dict.set_item("category_type", &self.category_type)?;
464464
dict.set_item("highest_index", self.highest_index)?;
@@ -467,7 +467,7 @@ impl Category {
467467
if let Some(fields) = &self.fields {
468468
for field in fields {
469469
let field_dict = field.to_dict(py)?;
470-
field_dicts.push(field_dict.to_object(py));
470+
field_dicts.push(field_dict);
471471
}
472472
dict.set_item("fields", field_dicts)?;
473473
} else {
@@ -533,7 +533,7 @@ impl State {
533533
}
534534

535535
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
536-
let dict = PyDict::new_bound(py);
536+
let dict = PyDict::new(py);
537537
dict.set_item("value", &self.value)?;
538538
dict.set_item("signer", &self.signer)?;
539539
dict.set_item("signer_unique_id", &self.signer_unique_id)?;
@@ -746,7 +746,7 @@ impl Form {
746746
}
747747

748748
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
749-
let dict = PyDict::new_bound(py);
749+
let dict = PyDict::new(py);
750750
dict.set_item("name", &self.name)?;
751751
dict.set_item(
752752
"last_modified",
@@ -772,7 +772,7 @@ impl Form {
772772
if let Some(states) = &self.states {
773773
for state in states {
774774
let state_dict = state.to_dict(py)?;
775-
state_dicts.push(state_dict.to_object(py));
775+
state_dicts.push(state_dict);
776776
}
777777
dict.set_item("states", state_dicts)?;
778778
} else {
@@ -783,7 +783,7 @@ impl Form {
783783
let mut category_dicts = Vec::new();
784784
for category in categories {
785785
let category_dict = category.to_dict(py)?;
786-
category_dicts.push(category_dict.to_object(py));
786+
category_dicts.push(category_dict);
787787
}
788788
dict.set_item("categories", category_dicts)?;
789789
} else {

src/native/deserializers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn to_py_datetime<'py>(
6060
py: Python<'py>,
6161
date_time: &DateTime<Utc>,
6262
) -> PyResult<Bound<'py, PyDateTime>> {
63-
let py_datetime = PyDateTime::new_bound(
63+
let py_datetime = PyDateTime::new(
6464
py,
6565
date_time.year(),
6666
date_time.month() as u8,
@@ -80,7 +80,7 @@ pub fn to_py_datetime_option<'py>(
8080
date_time: &Option<DateTime<Utc>>,
8181
) -> PyResult<Option<Bound<'py, PyDateTime>>> {
8282
if let Some(d) = date_time {
83-
let py_datetime = Some(PyDateTime::new_bound(
83+
let py_datetime = Some(PyDateTime::new(
8484
py,
8585
d.year(),
8686
d.month() as u8,

src/native/site_native.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl Site {
9696
}
9797

9898
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
99-
let dict = PyDict::new_bound(py);
99+
let dict = PyDict::new(py);
100100
dict.set_item("name", &self.name)?;
101101
dict.set_item("unique_id", &self.unique_id)?;
102102
dict.set_item("number_of_patients", self.number_of_patients)?;
@@ -112,7 +112,7 @@ impl Site {
112112
if let Some(forms) = &self.forms {
113113
for form in forms {
114114
let form_dict = form.to_dict(py)?;
115-
form_dicts.push(form_dict.to_object(py));
115+
form_dicts.push(form_dict);
116116
}
117117
dict.set_item("forms", form_dicts)?;
118118
} else {
@@ -153,11 +153,11 @@ impl SiteNative {
153153

154154
/// Convert the class instance to a dictionary
155155
fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
156-
let dict = PyDict::new_bound(py);
156+
let dict = PyDict::new(py);
157157
let mut site_dicts = Vec::new();
158158
for site in &self.sites {
159159
let site_dict = site.to_dict(py)?;
160-
site_dicts.push(site_dict.to_object(py));
160+
site_dicts.push(site_dict);
161161
}
162162
dict.set_item("sites", site_dicts)?;
163163
Ok(dict)

src/native/subject_native.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl Patient {
115115
}
116116

117117
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
118-
let dict = PyDict::new_bound(py);
118+
let dict = PyDict::new(py);
119119
dict.set_item("patient_id", &self.patient_id)?;
120120
dict.set_item("unique_id", &self.unique_id)?;
121121
dict.set_item("when_created", to_py_datetime(py, &self.when_created)?)?;
@@ -129,7 +129,7 @@ impl Patient {
129129
if let Some(forms) = &self.forms {
130130
for form in forms {
131131
let form_dict = form.to_dict(py)?;
132-
form_dicts.push(form_dict.to_object(py));
132+
form_dicts.push(form_dict);
133133
}
134134
dict.set_item("forms", form_dicts)?;
135135
} else {
@@ -169,11 +169,11 @@ impl SubjectNative {
169169

170170
/// Convert the class instance to a dictionary
171171
fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
172-
let dict = PyDict::new_bound(py);
172+
let dict = PyDict::new(py);
173173
let mut patient_dicts = Vec::new();
174174
for patient in &self.patients {
175175
let patient_dict = patient.to_dict(py)?;
176-
patient_dicts.push(patient_dict.to_object(py));
176+
patient_dicts.push(patient_dict);
177177
}
178178
dict.set_item("patients", patient_dicts)?;
179179
Ok(dict)

src/native/user_native.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl User {
7272
}
7373

7474
pub fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
75-
let dict = PyDict::new_bound(py);
75+
let dict = PyDict::new(py);
7676
dict.set_item("unique_id", &self.unique_id)?;
7777
dict.set_item("last_language", &self.last_language)?;
7878
dict.set_item("creator", &self.creator)?;
@@ -82,7 +82,7 @@ impl User {
8282
if let Some(forms) = &self.forms {
8383
for form in forms {
8484
let form_dict = form.to_dict(py)?;
85-
form_dicts.push(form_dict.to_object(py));
85+
form_dicts.push(form_dict);
8686
}
8787
dict.set_item("forms", form_dicts)?;
8888
} else {
@@ -122,11 +122,11 @@ impl UserNative {
122122

123123
/// Convert the class instance to a dictionary
124124
fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyDict>> {
125-
let dict = PyDict::new_bound(py);
125+
let dict = PyDict::new(py);
126126
let mut user_dicts = Vec::new();
127127
for user in &self.users {
128128
let user_dict = user.to_dict(py)?;
129-
user_dicts.push(user_dict.to_object(py));
129+
user_dicts.push(user_dict);
130130
}
131131
dict.set_item("users", user_dicts)?;
132132
Ok(dict)

0 commit comments

Comments
 (0)