Skip to content

Fix Python object API packing with no type prefixes#9013

Open
steadytao wants to merge 1 commit intogoogle:masterfrom
steadytao:fix-8715-python-object-api-no-type-prefix-suffix
Open

Fix Python object API packing with no type prefixes#9013
steadytao wants to merge 1 commit intogoogle:masterfrom
steadytao:fix-8715-python-object-api-no-type-prefix-suffix

Conversation

@steadytao
Copy link
Copy Markdown

Summary

Make Python object API Pack() generation respect --python-no-type-prefix-suffix.

Problem

When --gen-object-api and --python-no-type-prefix-suffix were used together, the generated Python helper functions were emitted without type prefixes but the object API Pack() methods still called prefixed names such as TableBooStart, TableBooAddTable1 and TableBooEnd.

That made the generated object API unusable with this flag combination.

Fix

  • make Python object API pack generation use option-aware helper names for:
    • table start/end
    • field add calls
    • vector start helpers
  • add a regression schema for the nested-table case from the issue report
  • add a Python regression test that packs and reads the generated object successfully

Testing

  • built flatc
  • generated Python code for the new regression schema with --gen-object-api --python-no-type-prefix-suffix
  • ran the new Python regression test
  • ran the surrounding TestObjectBasedAPI suite locally

Fixes #8715

Make Python object API Pack generation respect --python-no-type-prefix-suffix for table start, add, end, and vector helper calls.

Add a regression schema and Python test covering the nested-table Pack path reported in google#8715.

Fixes google#8715
@steadytao steadytao requested a review from dbaileychess as a code owner April 3, 2026 05:35
@github-actions github-actions bot added python c++ codegen Involving generating code from schema labels Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] '--python-no-type-prefix-suffix' and '--gen-object-api' are incompatible

1 participant