Look at autogenerate/render.py:245 function, it should add create_foreign_key calls.
The arguments provided are one for the operation.create_foreign_key call.
If we are in batch mode, we MUST omit the source table as it is redundant.

Then, the auto-generated call isn't valid at the end.

A quick workaround would be to patch the code and check for batch_prefix in autogen_context.
If we found it, we would pop the useless arguments and I think that should do it.

If you need more information about that, please, let me know! :)
Thanks for Alembic!

This comment has been minimized.

Thanks for reporting. please refer to the current master when reporting issues. All the render functions except for create_foreign_key are consulting the batch context and the test itself is also testing for the wrong call in test_autogen_composition.