`PyError (:PyObject_Call) None` when accessing python method in a worker process
- Lenguaje dominante
- Julia
- Estrellas
- 1.5k
- Forks
- 186
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
```
julia> Pkg.status("PyCall")
- PyCall 1.7.2 pinned.be354e07.tmp
julia> VERSION
v"0.4.5"
```
I'm using a python database library to connect to a database from Julia. Everything works correctly when I use the library from main process, but if I start a worker process using `addprocs` and try to call the method from the worker, I get a `PyError (:PyObject_Call) None` and I don't understand why.
The code in question looks like this:
```
println(typeof(cursor[:execute]))
cursor[:execute](sql, params)
```
The `println` prints `From worker 2: PyCall.PyObject`
The call to `:execute` throws:
```
On worker 2:
PyError (:PyObject_Call) None
[inlined code] from /home/ubuntu/.julia/v0.4/PyCall/src/exception.jl:81
in _pycall at /home/ubuntu/.julia/v0.4/PyCall/src/PyCall.jl:546
in pycall at /home/ubuntu/.julia/v0.4/PyCall/src/PyCall.jl:568
in call at /home/ubuntu/.julia/v0.4/PyCall/src/PyCall.jl:571
in getDataID at In[65]:12
in anonymous at multi.jl:923
in run_work_thunk at multi.jl:661
[inlined code] from multi.jl:923
in anonymous at task.jl:63
in remotecall_fetch at multi.jl:747
in remotecall_fetch at multi.jl:750
```
(`getDataID at In[65]:12` is the call to execute)
I've also verified that both `sql` and `params` contain the right values.
Does anyone know why I'd be getting the above error or where I'd look to debug it?
I've also tried using `pycall(cursor[:execute], PyObject, sql, params)` with the same result.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Reproduce the PyCall failure in a worker created with addprocs, comparing it with the successful main-process call. Start with PyCall/src/exception.jl and PyCall/src/PyCall.jl around the reported _pycall and pycall frames, then determine what differs for cursor[:execute] and its Python exception; done means the cause and a reproducible fix or documented limitation are established.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- backend, distributed-systems
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100