MCPcopy Create free account
hub / github.com/apache/arrow / IsModuleImported

Function IsModuleImported

python/pyarrow/src/arrow/python/helpers.cc:137–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137Result<bool> IsModuleImported(const std::string& module_name) {
138 // PyImport_GetModuleDict returns with a borrowed reference
139 OwnedRef key(PyUnicode_FromString(module_name.c_str()));
140 auto is_imported = PyDict_Contains(PyImport_GetModuleDict(), key.obj());
141 RETURN_IF_PYERROR();
142 return is_imported;
143}
144
145Status ImportModule(const std::string& module_name, OwnedRef* ref) {
146 PyObject* module = PyImport_ImportModule(module_name.c_str());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected