-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bugs in cmd options causing mutable fixtures to not be generated
Summary: The `:` as delimiter caused this option to be ignored. Reviewed By: aristidisp Differential Revision: D67117362 fbshipit-source-id: 871a38bafac7b57db23c4e45c097f19ef231d28b
- Loading branch information
1 parent
8b44361
commit b36b7cd
Showing
19 changed files
with
8,158 additions
and
30 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
121 changes: 121 additions & 0 deletions
121
...rate_mutable_types/gen-python/my/namespacing/test/module/module/thrift_mutable_clients.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# | ||
# Autogenerated by Thrift | ||
# | ||
# DO NOT EDIT | ||
# @generated | ||
# | ||
|
||
from __future__ import annotations | ||
|
||
import typing as _typing | ||
|
||
import apache.thrift.metadata.thrift_types as _fbthrift_metadata | ||
import folly.iobuf as _fbthrift_iobuf | ||
from thrift.python.client import ( | ||
AsyncClient as _fbthrift_python_AsyncClient, | ||
SyncClient as _fbthrift_python_SyncClient, | ||
Client as _fbthrift_python_Client, | ||
) | ||
from thrift.python.client.omni_client import InteractionMethodPosition as _fbthrift_InteractionMethodPosition, FunctionQualifier as _fbthrift_FunctionQualifier | ||
from thrift.python.common import RpcOptions | ||
import thrift.python.mutable_containers as _fbthrift_python_mutable_containers | ||
import thrift.python.mutable_exceptions as _fbthrift_python_mutable_exceptions | ||
import thrift.python.mutable_types as _fbthrift_python_mutable_types | ||
import thrift.python.exceptions as _fbthrift_python_exceptions | ||
import thrift.python.types as _fbthrift_python_types | ||
import python_module_root.my.namespacing.test.module.module.thrift_mutable_types as python_module_root__my__namespacing__test__module__module__thrift_mutable_types | ||
import python_module_root.my.namespacing.test.module.module.thrift_metadata | ||
|
||
class TestService(_fbthrift_python_Client["TestService.Async", "TestService.Sync"]): | ||
@staticmethod | ||
def __get_thrift_name__() -> str: | ||
return "module.TestService" | ||
|
||
@staticmethod | ||
def __get_thrift_uri__() -> _typing.Optional[str]: | ||
return None | ||
|
||
@staticmethod | ||
def __get_thrift_unstructured_annotations_DEPRECATED__() -> _typing.Mapping[str, str]: | ||
return { | ||
} | ||
|
||
@staticmethod | ||
def __get_metadata__() -> _fbthrift_metadata.ThriftMetadata: | ||
return python_module_root.my.namespacing.test.module.module.thrift_metadata.gen_metadata_service_TestService() | ||
|
||
class Async(_fbthrift_python_AsyncClient): | ||
@staticmethod | ||
def __get_thrift_name__() -> str: | ||
return "module.TestService" | ||
|
||
@staticmethod | ||
def __get_thrift_uri__() -> _typing.Optional[str]: | ||
return None | ||
|
||
@staticmethod | ||
def __get_metadata__() -> _fbthrift_metadata.ThriftMetadata: | ||
return python_module_root.my.namespacing.test.module.module.thrift_metadata.gen_metadata_service_TestService() | ||
|
||
async def init( | ||
self, | ||
int1: int, | ||
*, | ||
rpc_options: _typing.Optional[RpcOptions] = None, | ||
) -> int: | ||
_fbthrift_resp = await self._send_request( | ||
"TestService", | ||
"init", | ||
python_module_root__my__namespacing__test__module__module__thrift_mutable_types._fbthrift_TestService_init_args( | ||
int1=int1,), | ||
python_module_root__my__namespacing__test__module__module__thrift_mutable_types._fbthrift_TestService_init_result, | ||
qualifier = _fbthrift_FunctionQualifier.Unspecified, | ||
uri_or_name="TestService", | ||
rpc_options=rpc_options, | ||
is_mutable_types=True, | ||
) | ||
# shortcut to success path for non-void returns | ||
if _fbthrift_resp.success is not None: | ||
return _fbthrift_resp.success | ||
raise _fbthrift_python_exceptions.ApplicationError( | ||
_fbthrift_python_exceptions.ApplicationErrorType.MISSING_RESULT, | ||
"Empty Response", | ||
) | ||
|
||
class Sync(_fbthrift_python_SyncClient): | ||
@staticmethod | ||
def __get_thrift_name__() -> str: | ||
return "module.TestService" | ||
|
||
@staticmethod | ||
def __get_thrift_uri__() -> _typing.Optional[str]: | ||
return None | ||
|
||
@staticmethod | ||
def __get_metadata__() -> _fbthrift_metadata.ThriftMetadata: | ||
return python_module_root.my.namespacing.test.module.module.thrift_metadata.gen_metadata_service_TestService() | ||
|
||
def init( | ||
self, | ||
int1: int, | ||
*, | ||
rpc_options: _typing.Optional[RpcOptions] = None, | ||
) -> int: | ||
_fbthrift_resp = self._send_request( | ||
"TestService", | ||
"init", | ||
python_module_root__my__namespacing__test__module__module__thrift_mutable_types._fbthrift_TestService_init_args( | ||
int1=int1,), | ||
python_module_root__my__namespacing__test__module__module__thrift_mutable_types._fbthrift_TestService_init_result, | ||
uri_or_name="TestService", | ||
rpc_options=rpc_options, | ||
is_mutable_types=True, | ||
) | ||
# shortcut to success path for non-void returns | ||
if _fbthrift_resp.success is not None: | ||
return _fbthrift_resp.success | ||
raise _fbthrift_python_exceptions.ApplicationError( | ||
_fbthrift_python_exceptions.ApplicationErrorType.MISSING_RESULT, | ||
"Empty Response", | ||
) | ||
|
63 changes: 63 additions & 0 deletions
63
...ate_mutable_types/gen-python/my/namespacing/test/module/module/thrift_mutable_services.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# Autogenerated by Thrift | ||
# | ||
# DO NOT EDIT | ||
# @generated | ||
# | ||
|
||
from __future__ import annotations | ||
|
||
from abc import ABCMeta | ||
import typing as _typing | ||
|
||
import folly.iobuf as _fbthrift_iobuf | ||
|
||
import apache.thrift.metadata.thrift_types as _fbthrift_metadata | ||
import thrift.python.mutable_containers as _fbthrift_python_mutable_containers | ||
from thrift.python.mutable_serializer import serialize_iobuf, deserialize, Protocol | ||
from thrift.python.server import ServiceInterface, RpcKind, PythonUserException | ||
|
||
import python_module_root.my.namespacing.test.module.module.thrift_mutable_types as python_module_root__my__namespacing__test__module__module__thrift_mutable_types | ||
import python_module_root.my.namespacing.test.module.module.thrift_metadata | ||
|
||
class TestServiceInterface( | ||
ServiceInterface, | ||
metaclass=ABCMeta | ||
): | ||
|
||
@staticmethod | ||
def service_name() -> bytes: | ||
return b"TestService" | ||
|
||
def getFunctionTable(self) -> _typing.Mapping[bytes, _typing.Callable[..., object]]: | ||
functionTable = { | ||
b"init": (RpcKind.SINGLE_REQUEST_SINGLE_RESPONSE, self._fbthrift__handler_init), | ||
} | ||
return {**super().getFunctionTable(), **functionTable} | ||
|
||
@staticmethod | ||
def __get_thrift_name__() -> str: | ||
return "module.TestService" | ||
|
||
@staticmethod | ||
def __get_metadata__() -> _fbthrift_metadata.ThriftMetadata: | ||
return python_module_root.my.namespacing.test.module.module.thrift_metadata.gen_metadata_service_TestService() | ||
|
||
@staticmethod | ||
def __get_metadata_service_response__() -> _fbthrift_metadata.ThriftServiceMetadataResponse: | ||
return python_module_root.my.namespacing.test.module.module.thrift_metadata._fbthrift_metadata_service_response_TestService() | ||
|
||
|
||
|
||
async def init( | ||
self, | ||
int1: int | ||
) -> int: | ||
raise NotImplementedError("async def init is not implemented") | ||
|
||
async def _fbthrift__handler_init(self, args: _fbthrift_iobuf.IOBuf, protocol: Protocol) -> _fbthrift_iobuf.IOBuf: | ||
args_struct = deserialize(python_module_root__my__namespacing__test__module__module__thrift_mutable_types._fbthrift_TestService_init_args, args, protocol) | ||
value = await self.init(args_struct.int1,) | ||
return_struct = python_module_root__my__namespacing__test__module__module__thrift_mutable_types._fbthrift_TestService_init_result(success=value) | ||
return serialize_iobuf(return_struct, protocol) | ||
|
Oops, something went wrong.