You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "asukaminato0721 (via GitHub)" <gi...@apache.org> on 2025/04/07 05:04:49 UTC

[PR] add check in py [opendal]

asukaminato0721 opened a new pull request, #5973:
URL: https://github.com/apache/opendal/pull/5973

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   part of #5963.
   
   # Rationale for this change
   
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   user can use blocking check and unblocking check in py binding
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking-changes` label.
   -->
   


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5973:
URL: https://github.com/apache/opendal/pull/5973#discussion_r2032362797


##########
bindings/python/src/operator.rs:
##########
@@ -236,6 +236,14 @@ impl Operator {
         ))
     }
 
+    /// Check if this operator can work correctly.
+    pub fn check(&self) -> PyResult<()> {
+        let runtime = pyo3_async_runtimes::tokio::get_runtime();
+        let _guard = runtime.enter();

Review Comment:
   this is a temp solution maybe we can find a better solution 
   since we have this in build operator side



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2785199222

   others LGTM, will try to find why the doc failed


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "Kilerd (via GitHub)" <gi...@apache.org>.
Kilerd commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2786597396

   > reproduce in local
   > 
   > bt
   > 
   > ```
   > thread '<unnamed>' panicked at /Users/hyi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-0.8.3/src/pool/connection.rs:208:13:
   > this functionality requires a Tokio context
   > stack backtrace:
   >    0: _rust_begin_unwind
   >    1: core::panicking::panic_fmt
   >    2: sqlx_core::rt::missing_rt
   >    3: sqlx_core::rt::spawn
   >    4: <sqlx_core::pool::connection::PoolConnection<DB> as core::ops::drop::Drop>::drop
   >    5: core::ptr::drop_in_place<sqlx_core::pool::connection::PoolConnection<sqlx_sqlite::database::Sqlite>>
   >    6: core::ptr::drop_in_place<sqlx_core::pool::executor::<impl sqlx_core::executor::Executor for &sqlx_core::pool::Pool<sqlx_sqlite::database::Sqlite>>::fetch_many<sqlx_core::query::Query<sqlx_sqlite::database::Sqlite,sqlx_sqlite::arguments::SqliteArguments>>::{{closure}}::{{closure}}>
   >    7: core::ptr::drop_in_place<sqlx_core::ext::async_stream::TryAsyncStream<either::Either<sqlx_sqlite::query_result::SqliteQueryResult,sqlx_sqlite::row::SqliteRow>>>
   >    8: core::ptr::drop_in_place<futures_util::stream::stream::map::Map<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream+Item = core::result::Result<alloc::string::String,sqlx_core::error::Error>+core::marker::Send>>,<opendal::services::sqlite::backend::Adapter as opendal::raw::adapters::kv::api::Adapter>::scan::{{closure}}::{{closure}}::{{closure}}>>
   >    9: core::ptr::drop_in_place<futures_util::stream::try_stream::try_filter_map::TryFilterMap<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream+Item = core::result::Result<either::Either<sqlx_sqlite::query_result::SqliteQueryResult,(alloc::string::String,)>,sqlx_core::error::Error>+core::marker::Send>>,sqlx_core::query_as::QueryAs<sqlx_sqlite::database::Sqlite,(alloc::string::String,),sqlx_sqlite::arguments::SqliteArguments>::fetch<&sqlx_core::pool::Pool<sqlx_sqlite::database::Sqlite>>::{{closure}}::{{closure}},sqlx_core::query_as::QueryAs<sqlx_sqlite::database::Sqlite,(alloc::string::String,),sqlx_sqlite::arguments::SqliteArguments>::fetch<&sqlx_core::pool::Pool<sqlx_sqlite::database::Sqlite>>::{{closure}}>>
   >   10: core::ptr::drop_in_place<futures_util::stream::stream::map::Map<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream+Item = core::result::Result<alloc::string::String,sqlx_core::error::Error>+core::marker::Send>>,<opendal::services::sqlite::backend::Adapter as opendal::raw::adapters::kv::api::Adapter>::scan::{{closure}}::{{closure}}::{{closure}}>>
   >   11: core::ptr::drop_in_place<futures_util::stream::stream::map::Map<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream+Item = core::result::Result<alloc::string::String,sqlx_core::error::Error>+core::marker::Send>>,<opendal::services::sqlite::backend::Adapter as opendal::raw::adapters::kv::api::Adapter>::scan::{{closure}}::{{closure}}::{{closure}}>>
   >   12: <opendal::services::sqlite::backend::ouroboros_impl_sqlite_scanner::SqliteScanner as core::ops::drop::Drop>::drop
   >   13: core::ptr::drop_in_place<opendal::raw::oio::list::hierarchy_list::HierarchyLister<opendal::raw::adapters::kv::backend::KvLister<opendal::services::sqlite::backend::ouroboros_impl_sqlite_scanner::SqliteScanner>>>
   >   14: core::ptr::drop_in_place<opendal::layers::blocking::BlockingWrapper<alloc::boxed::Box<dyn opendal::raw::oio::list::api::ListDyn>>>
   >   15: core::ptr::drop_in_place<opendal::layers::retry::RetryWrapper<alloc::boxed::Box<dyn opendal::raw::oio::list::api::BlockingList>,opendal::layers::retry::DefaultRetryInterceptor>>
   >   16: core::ptr::drop_in_place<opendal::layers::concurrent_limit::ConcurrentLimitWrapper<alloc::boxed::Box<dyn opendal::raw::oio::list::api::BlockingList>>>
   >   17: opendal::types::operator::blocking_operator::BlockingOperator::check
   >   18: opendal_python::operator::Operator::__pymethod_check__
   >   19: pyo3::impl_::trampoline::trampoline
   >   20: opendal_python::operator::<impl pyo3::impl_::pyclass::PyMethods<opendal_python::operator::Operator> for pyo3::impl_::pyclass::PyClassImplCollector<opendal_python::operator::Operator>>::py_methods::ITEMS::trampoline
   >   21: _method_vectorcall_NOARGS.llvm.11409851845177106966
   >   22: __PyEval_EvalFrameDefault
   >   23: __PyObject_Call_Prepend
   >   24: _slot_tp_call
   >   25: __PyEval_EvalFrameDefault
   >   26: __PyObject_Call_Prepend
   >   27: _slot_tp_call
   >   28: __PyEval_EvalFrameDefault
   >   29: __PyObject_Call_Prepend
   >   30: _slot_tp_call
   >   31: __PyEval_EvalFrameDefault
   >   32: __PyObject_Call_Prepend
   >   33: _slot_tp_call
   >   34: __PyEval_EvalFrameDefault
   >   35: __PyObject_Call_Prepend
   >   36: _slot_tp_call
   >   37: __PyEval_EvalFrameDefault
   >   38: _PyEval_EvalCode
   >   39: _run_eval_code_obj
   >   40: _run_mod.llvm.1117032873449786082
   >   41: _pyrun_file
   >   42: __PyRun_SimpleFileObject
   >   43: __PyRun_AnyFileObject
   >   44: _pymain_run_file_obj
   >   45: _pymain_run_file
   >   46: _Py_RunMain
   >   47: _pymain_main
   >   48: _Py_BytesMain
   > note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
   > ```
   
   the reason why the error raise is, services depended on `sqlx`, like sqlite, mysql and postgres,  need to drop connections when exiting. and due the the limitation of rust `Drop` trait, they need to spawn an async task to close connection on `Drop` trait, in other words, it's the async drop scenario. 
   
   after going through the implement of `sqlx`,  it spawn the task of closing conn via `crate::rt::spawn` (https://github.com/launchbadge/sqlx/blob/082aed5c2b6e68172bf29c377c3f5c87ca17cde4/sqlx-core/src/pool/connection.rs#L208). while there is no tokio runtime in python environment.
   
   P.S. it might crash on those services which depended on `sqlx`: sqlite, mysql, postgres


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2811523041

   let's merge main to see the error still exists?


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5973:
URL: https://github.com/apache/opendal/pull/5973#discussion_r2032754368


##########
bindings/python/src/operator.rs:
##########
@@ -236,6 +236,14 @@ impl Operator {
         ))
     }
 
+    /// Check if this operator can work correctly.
+    pub fn check(&self) -> PyResult<()> {
+        let runtime = pyo3_async_runtimes::tokio::get_runtime();
+        let _guard = runtime.enter();

Review Comment:
   It's wired that only this function need workaround. If `check` failed, the `list` should also fail too. I'm guessing all services related to sqlx will fail as well.
   
   We should identify the root cause and fix it in the core instead. Having such a workaround in the bindings doesn't seem ideal to me.



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2785026530

   @asukaminato0721 
   
   you can change to this and test
   
   and we may create an issue about this 
   ```
       pub fn check(&self) -> PyResult<()> {
           let runtime = pyo3_async_runtimes::tokio::get_runtime();
           let _guard = runtime.enter();
           
           self.core.check().map_err(format_pyerr)
       }
   
   ```


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #5973:
URL: https://github.com/apache/opendal/pull/5973


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2788285994

   I believe this issue is complex enough that we need a separate one for it.


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "asukaminato0721 (via GitHub)" <gi...@apache.org>.
asukaminato0721 commented on code in PR #5973:
URL: https://github.com/apache/opendal/pull/5973#discussion_r2032935100


##########
bindings/python/src/operator.rs:
##########
@@ -236,6 +236,14 @@ impl Operator {
         ))
     }
 
+    /// Check if this operator can work correctly.
+    pub fn check(&self) -> PyResult<()> {
+        let runtime = pyo3_async_runtimes::tokio::get_runtime();
+        let _guard = runtime.enter();

Review Comment:
   add a bit test, seems that `list` doesn't fail
   



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2785018116

   reproduce in local
   
   bt
   
   ```
   thread '<unnamed>' panicked at /Users/hyi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-0.8.3/src/pool/connection.rs:208:13:
   this functionality requires a Tokio context
   stack backtrace:
      0: _rust_begin_unwind
      1: core::panicking::panic_fmt
      2: sqlx_core::rt::missing_rt
      3: sqlx_core::rt::spawn
      4: <sqlx_core::pool::connection::PoolConnection<DB> as core::ops::drop::Drop>::drop
      5: core::ptr::drop_in_place<sqlx_core::pool::connection::PoolConnection<sqlx_sqlite::database::Sqlite>>
      6: core::ptr::drop_in_place<sqlx_core::pool::executor::<impl sqlx_core::executor::Executor for &sqlx_core::pool::Pool<sqlx_sqlite::database::Sqlite>>::fetch_many<sqlx_core::query::Query<sqlx_sqlite::database::Sqlite,sqlx_sqlite::arguments::SqliteArguments>>::{{closure}}::{{closure}}>
      7: core::ptr::drop_in_place<sqlx_core::ext::async_stream::TryAsyncStream<either::Either<sqlx_sqlite::query_result::SqliteQueryResult,sqlx_sqlite::row::SqliteRow>>>
      8: core::ptr::drop_in_place<futures_util::stream::stream::map::Map<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream+Item = core::result::Result<alloc::string::String,sqlx_core::error::Error>+core::marker::Send>>,<opendal::services::sqlite::backend::Adapter as opendal::raw::adapters::kv::api::Adapter>::scan::{{closure}}::{{closure}}::{{closure}}>>
      9: core::ptr::drop_in_place<futures_util::stream::try_stream::try_filter_map::TryFilterMap<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream+Item = core::result::Result<either::Either<sqlx_sqlite::query_result::SqliteQueryResult,(alloc::string::String,)>,sqlx_core::error::Error>+core::marker::Send>>,sqlx_core::query_as::QueryAs<sqlx_sqlite::database::Sqlite,(alloc::string::String,),sqlx_sqlite::arguments::SqliteArguments>::fetch<&sqlx_core::pool::Pool<sqlx_sqlite::database::Sqlite>>::{{closure}}::{{closure}},sqlx_core::query_as::QueryAs<sqlx_sqlite::database::Sqlite,(alloc::string::String,),sqlx_sqlite::arguments::SqliteArguments>::fetch<&sqlx_core::pool::Pool<sqlx_sqlite::database::Sqlite>>::{{closure}}>>
     10: core::ptr::drop_in_place<futures_util::stream::stream::map::Map<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream+Item = core::result::Result<alloc::string::String,sqlx_core::error::Error>+core::marker::Send>>,<opendal::services::sqlite::backend::Adapter as opendal::raw::adapters::kv::api::Adapter>::scan::{{closure}}::{{closure}}::{{closure}}>>
     11: core::ptr::drop_in_place<futures_util::stream::stream::map::Map<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream+Item = core::result::Result<alloc::string::String,sqlx_core::error::Error>+core::marker::Send>>,<opendal::services::sqlite::backend::Adapter as opendal::raw::adapters::kv::api::Adapter>::scan::{{closure}}::{{closure}}::{{closure}}>>
     12: <opendal::services::sqlite::backend::ouroboros_impl_sqlite_scanner::SqliteScanner as core::ops::drop::Drop>::drop
     13: core::ptr::drop_in_place<opendal::raw::oio::list::hierarchy_list::HierarchyLister<opendal::raw::adapters::kv::backend::KvLister<opendal::services::sqlite::backend::ouroboros_impl_sqlite_scanner::SqliteScanner>>>
     14: core::ptr::drop_in_place<opendal::layers::blocking::BlockingWrapper<alloc::boxed::Box<dyn opendal::raw::oio::list::api::ListDyn>>>
     15: core::ptr::drop_in_place<opendal::layers::retry::RetryWrapper<alloc::boxed::Box<dyn opendal::raw::oio::list::api::BlockingList>,opendal::layers::retry::DefaultRetryInterceptor>>
     16: core::ptr::drop_in_place<opendal::layers::concurrent_limit::ConcurrentLimitWrapper<alloc::boxed::Box<dyn opendal::raw::oio::list::api::BlockingList>>>
     17: opendal::types::operator::blocking_operator::BlockingOperator::check
     18: opendal_python::operator::Operator::__pymethod_check__
     19: pyo3::impl_::trampoline::trampoline
     20: opendal_python::operator::<impl pyo3::impl_::pyclass::PyMethods<opendal_python::operator::Operator> for pyo3::impl_::pyclass::PyClassImplCollector<opendal_python::operator::Operator>>::py_methods::ITEMS::trampoline
     21: _method_vectorcall_NOARGS.llvm.11409851845177106966
     22: __PyEval_EvalFrameDefault
     23: __PyObject_Call_Prepend
     24: _slot_tp_call
     25: __PyEval_EvalFrameDefault
     26: __PyObject_Call_Prepend
     27: _slot_tp_call
     28: __PyEval_EvalFrameDefault
     29: __PyObject_Call_Prepend
     30: _slot_tp_call
     31: __PyEval_EvalFrameDefault
     32: __PyObject_Call_Prepend
     33: _slot_tp_call
     34: __PyEval_EvalFrameDefault
     35: __PyObject_Call_Prepend
     36: _slot_tp_call
     37: __PyEval_EvalFrameDefault
     38: _PyEval_EvalCode
     39: _run_eval_code_obj
     40: _run_mod.llvm.1117032873449786082
     41: _pyrun_file
     42: __PyRun_SimpleFileObject
     43: __PyRun_AnyFileObject
     44: _pymain_run_file_obj
     45: _pymain_run_file
     46: _Py_RunMain
     47: _pymain_main
     48: _Py_BytesMain
   note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
   ```


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2785785626

   did not reproduce why the doc failed...


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "asukaminato0721 (via GitHub)" <gi...@apache.org>.
asukaminato0721 commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2784571220

   ```py
       @pytest.mark.need_capability("list")
       def test_sync_copy(service_name, operator, async_operator):
   >       operator.check()
   E       pyo3_runtime.PanicException: this functionality requires a Tokio context
   ```
   
   only this failed.
   


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "asukaminato0721 (via GitHub)" <gi...@apache.org>.
asukaminato0721 commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2785196328

   now only [Docs / build-website (pull_request)](https://github.com/apache/opendal/actions/runs/14325053735/job/40149094435?pr=5973) failed. All tests are passed.


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "asukaminato0721 (via GitHub)" <gi...@apache.org>.
asukaminato0721 commented on code in PR #5973:
URL: https://github.com/apache/opendal/pull/5973#discussion_r2048282163


##########
bindings/python/src/operator.rs:
##########
@@ -236,6 +236,14 @@ impl Operator {
         ))
     }
 
+    /// Check if this operator can work correctly.
+    pub fn check(&self) -> PyResult<()> {
+        let runtime = pyo3_async_runtimes::tokio::get_runtime();
+        let _guard = runtime.enter();

Review Comment:
   ```suggestion
   ```



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on PR #5973:
URL: https://github.com/apache/opendal/pull/5973#issuecomment-2784924766

   > ```python
   >     @pytest.mark.need_capability("list")
   >     def test_sync_copy(service_name, operator, async_operator):
   > >       operator.check()
   > E       pyo3_runtime.PanicException: this functionality requires a Tokio context
   > ```
   > 
   > only this failed.
   
   interesting will take a look and try to learn it today


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5973:
URL: https://github.com/apache/opendal/pull/5973#discussion_r2032362797


##########
bindings/python/src/operator.rs:
##########
@@ -236,6 +236,14 @@ impl Operator {
         ))
     }
 
+    /// Check if this operator can work correctly.
+    pub fn check(&self) -> PyResult<()> {
+        let runtime = pyo3_async_runtimes::tokio::get_runtime();
+        let _guard = runtime.enter();

Review Comment:
   this is a temp solution maybe we can find a better solution 
   since we have this in build operator isde



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5973:
URL: https://github.com/apache/opendal/pull/5973#discussion_r2032763107


##########
bindings/python/src/operator.rs:
##########
@@ -236,6 +236,14 @@ impl Operator {
         ))
     }
 
+    /// Check if this operator can work correctly.
+    pub fn check(&self) -> PyResult<()> {
+        let runtime = pyo3_async_runtimes::tokio::get_runtime();
+        let _guard = runtime.enter();

Review Comment:
   > It's wired that only this function need workaround. If `check` failed, the `list` should also fail too. I'm guessing all services related to sqlx will fail as well.
   > 
   > We should identify the root cause and fix it in the core instead. Having such a workaround in the bindings doesn't seem ideal to me.
   
   yes agree and will try to help these days



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(bindings/python): add check in py [opendal]

Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5973:
URL: https://github.com/apache/opendal/pull/5973#discussion_r2033073680


##########
bindings/python/src/operator.rs:
##########
@@ -236,6 +236,14 @@ impl Operator {
         ))
     }
 
+    /// Check if this operator can work correctly.
+    pub fn check(&self) -> PyResult<()> {
+        let runtime = pyo3_async_runtimes::tokio::get_runtime();
+        let _guard = runtime.enter();

Review Comment:
   > services related to sqlx will fail as well.
   seems yes postgres and mysql are skipped



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org