danielgtaylor / danielgtaylor/python-betterproto
Missing betterproto_lib_google_protobuf import if only used as rpc call parameter.
- Lingua principale
- Python
- Stelle
- 1.8k
- Fork
- 234
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I'm using 2.0.0b5.
The following file results in broken python:
```proto
syntax = "proto3";
package experiment;
import "google/protobuf/empty.proto";
message Reply {
bool happy = 1;
}
service Testcase {
rpc call(google.protobuf.Empty) returns (Reply);
}
```
Specifically, the import `import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf` is missing from the output file.
When any `google.protobuf` imported field is used anywhere else, it does work correctly, for example, the following files all work:
```proto
syntax = "proto3";
package experiment;
import "google/protobuf/empty.proto";
message Reply {
bool happy = 1;
}
service Testcase {
rpc call(Reply) returns (google.protobuf.Empty);
}
```
```proto
syntax = "proto3";
package experiment;
import "google/protobuf/empty.proto";
message Reply {
bool happy = 1;
google.protobuf.Empty e = 2;
}
service Testcase {
rpc call(google.protobuf.Empty) returns (Reply);
}
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Riproduci il problema con l’input .proto fornito e ispeziona il file di output Python generato. Confronta l’import della dipendenza mancante quando Empty viene usato solo come parametro RPC con i casi funzionanti di valore restituito e campo; il lavoro è completato quando il modulo generato include l’import richiesto e rimane Python valido.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100