abhiaagarwal commented on code in PR #5566:
URL: https://github.com/apache/arrow-rs/pull/5566#discussion_r1546816258
##########
arrow/src/pyarrow.rs:
##########
@@ -101,15 +106,19 @@ impl<T: ToPyArrow> IntoPyArrow for T {
}
}
-fn validate_class(expected: &str, value: &PyAny) -> PyResult<()> {
- let pyarrow = PyModule::import(value.py(), "pyarrow")?;
+fn validate_class(expected: &str, value: &Bound<PyAny>) -> PyResult<()> {
+ let pyarrow = PyModule::import_bound(value.py(), "pyarrow")?;
let class = pyarrow.getattr(expected)?;
- if !value.is_instance(class)? {
- let expected_module = class.getattr("__module__")?.extract::<&str>()?;
- let expected_name = class.getattr("__name__")?.extract::<&str>()?;
+ if !value.is_instance(&class)? {
+ let expected_module = class.getattr("__module__")?;
+ let expected_module = expected_module.extract::<&str>()?;
+ let expected_name = class.getattr("__name__")?;
+ let expected_name = expected_name.extract::<&str>()?;
let found_class = value.get_type();
- let found_module =
found_class.getattr("__module__")?.extract::<&str>()?;
- let found_name = found_class.getattr("__name__")?.extract::<&str>()?;
+ let found_module = found_class.getattr("__module__")?;
+ let found_module = found_module.extract::<&str>()?;
+ let found_name = found_class.getattr("__name__")?;
+ let found_name = found_name.extract::<&str>()?;
Review Comment:
@Jefffrey these `extract`s should be changed to `extract_bound`. `extract`
only exists with `gil-refs` enabled. I have no clue why the `extract` version
is passing CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]