diff --git a/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_item.mustache b/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_item.mustache index 9b3f5b7479ff59..88e54976e03cd3 100644 --- a/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_item.mustache +++ b/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_item.mustache @@ -52,6 +52,13 @@ key, include the parallel CythonPythonToCppKey file instead. }}python_to_cpp[{{> types/cython_cpp_basic_type}}](item){{! }}{{/program:auto_migrate?}}{{! }}{{/type:struct}}{{! -}}{{#type:container?}}{{type:flat_name}}__make_instance(item){{/type:container?}}{{! +}}{{#type:container?}}{{! + }}{{^program:auto_migrate?}}{{! + }}{{> types/container_to_cpp }}(item){{! + }}{{/program:auto_migrate?}}{{! + }}{{#program:auto_migrate?}}{{! + }}{{type:flat_name}}__make_instance(item){{! + }}{{/program:auto_migrate?}}{{! +}}{{/type:container?}}{{! }}{{#type:enum?}}<{{> types/cython_cpp_type}}>item{{/type:enum?}}{{! }}{{/type:customBinaryType?}} diff --git a/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_key.mustache b/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_key.mustache index a30fc76d6ff4ee..ada4ec137f5b03 100644 --- a/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_key.mustache +++ b/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_key.mustache @@ -43,6 +43,11 @@ keys (conventionally used for sets, lists, and map values). }}{{/program:auto_migrate?}}{{! }}{{/type:struct}}{{! }}{{#type:container?}}{{! - }}{{type:flat_name}}__make_instance(key){{! + }}{{^program:auto_migrate?}}{{! + }}{{> types/container_to_cpp }}(key){{! + }}{{/program:auto_migrate?}}{{! + }}{{#program:auto_migrate?}}{{! + }}{{type:flat_name}}__make_instance(key){{! + }}{{/program:auto_migrate?}}{{! }}{{/type:container?}}{{! }}{{#type:enum?}}<{{> types/cython_cpp_type}}>key{{/type:enum?}}