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
Make isinstance/issubclass checks pass when auto-migrate mode is passed for thrift.py3.{Struct,Union}
Summary:
When we're in auto-migrate mode, we want instance checks against `thrift.py3.Struct` to still pass (as there's a lot of user code that checks `isinstance(my_struct, thrift.py3.Struct)` to do some logic that is for thrift-py3 and otherwise do logic that is for thrift-py-deprecated.
This makes it such that for thrift-python structs/unions, `._fbthrift_auto_migrate_enabled()` is checked, which is a bool that gets set to true when auto-migrate is enabled, so in normal build mode, `isinstance(python_struct, thrift.py3.Struct)` returns `False`, but in auto-migrate mode returns `True`
Reviewed By: prakashgayasen
Differential Revision: D68765988
fbshipit-source-id: 8e93fd6c526969dfe98201e3b8a3d68d31f97670
Copy file name to clipboardexpand all lines: thrift/compiler/test/fixtures/adapter/out/python_with_containers/gen-python/with_containers/thrift_types.py
Copy file name to clipboardexpand all lines: thrift/compiler/test/fixtures/basic/out/python_service/gen-python/meta/example/thrift/service/thrift_types.py
0 commit comments