You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change types_reflection.py to use thrift-py3 specific thrift types import
Summary:
Previously, thrift py3 container flatnames were made available in auto-migrate mode in D66985311, but only when imported from `.types` rather than `.thrift_types`. In `types_reflection.py` we were importing from `.thrift_types` when building in auto-migrate mode, which meant that the container flatname types were not available, which meant any code trying to introspect on containers wasn't working.
Fixing this by changing the import alias to be `.types` even in auto-migrate mode.
Reviewed By: yoney, prakashgayasen
Differential Revision: D68756851
fbshipit-source-id: 0d26ca0a1c7bc69d55ba831bdb7b137504e3bc66
Copy file name to clipboardexpand all lines: thrift/compiler/generate/templates/py3/types_reflection.py.mustache
+1-1
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ import {{#includeNamespace}}{{value}}.{{/includeNamespace}}types as _{{#includeN
54
54
{{/hasTypes?}}
55
55
{{/program:includeNamespaces}}
56
56
57
-
import {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.{{> common/auto_migrate_import_prefix }}types as _{{#program:py3Namespaces}}{{value}}_{{/program:py3Namespaces}}{{program:name}}_types
57
+
import {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.types as _{{#program:py3Namespaces}}{{value}}_{{/program:py3Namespaces}}{{program:name}}_types
Copy file name to clipboardexpand all lines: thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/types_reflection.py
Copy file name to clipboardexpand all lines: thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/types_reflection.py
Copy file name to clipboardexpand all lines: thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/types_reflection.py
Copy file name to clipboardexpand all lines: thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_reflection.py
0 commit comments