-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate service functions on the thrift python client class
Summary: The concept of async and sync clients is new to thrift python, in thrift py3 every client was async, and the client methods were located directly on the class. This leads to potential issues when enabling auto-migrate as these methods are no longer there. Just sticking references to the Async class methods directly on the class itself to avoid this problem. This does require a bit of a hack in that we have to tell pyre to ignore the fact that we have no annotation. I'm not 100% sure this is correct, but I was looking into adding the correct annotation and what pyre expects here is something like: `typing.Callable(Async.getMetadaField)[[Named(self, Async), Named(key, str), KeywordOnly(rpc_options, Optional[RpcOptions], default)], Coroutine[typing.Any, typing.Any, str]]`, and this just seems like way too much duplication to me. Optimally I'd like tell pyre to just use the inferred type but I don't think there's any to do that. Reviewed By: ahilger Differential Revision: D67056477 fbshipit-source-id: 06aa228b911a24f087cbff56803934356d5d1a94
- Loading branch information
1 parent
94a937a
commit 10edf95
Showing
41 changed files
with
916 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.