JuliaPy / JuliaPy/PyCall.jl

`PyError (:PyObject_Call) None` when accessing python method in a worker process

Ouverte
#400 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Julia
Étoiles
1.5k
Forks
186
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

```
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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Reproduire l’échec de PyCall dans un worker créé avec addprocs, en le comparant à l’appel réussi dans le processus principal. Commencez par PyCall/src/exception.jl et PyCall/src/PyCall.jl autour des frames _pycall et pycall signalés, puis déterminez ce qui diffère pour cursor[:execute] et son exception Python ; le travail est terminé lorsque la cause et une correction reproductible ou une limitation documentée sont établies.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
backend, distributed-systems
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.