danielgtaylor / danielgtaylor/python-betterproto
Reflections don't work (I may know why)
- Vorherrschende Sprache
- Python
- Sterne
- 1.8k
- Forks
- 234
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I use server reflection as defined in [the documentation](https://grpclib.readthedocs.io/en/latest/reflection.html) and I have a single service called `helloworld.Greeter`.
gRPC call `list_services: "*"` is processed fine and returns a single service `helloworld.Greeter`.
However, `file_containing_symbol: "helloworld.Greeter"` only returns an error `not found`
Throughout my own investigation I found that error can be traced to
[grpclib/reflection/_deprecated.py:L79](https://github.com/vmagamedov/grpclib/blob/master/grpclib/reflection/_deprecated.py#L79)
Where `self._pool` does not have any descriptors for `helloworld.Greeter` or any of its methods
I suspect that [THIS](https://github.com/vmagamedov/grpclib/blob/master/examples/helloworld/helloworld_pb2.py#L17) is how the descriptors should be added in order for reflections to work with betterproto
Beitragsleitfaden
Rechercherichtung
Beginne damit, die im Issue beschriebenen Reflection-Aufrufe zu reproduzieren, und untersuche dann grpclib/reflection/_deprecated.py an der verlinkten Lookup-Stelle sowie examples/helloworld/helloworld_pb2.py an der verlinkten Descriptor-Einrichtung. Als abgeschlossen gilt die Aufgabe, wenn file_containing_symbol für helloworld.Greeter erfolgreich aufgelöst wird und list_services weiterhin den Service zurückgibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- grpc, python
- Bereich
- api, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100