BUG: to_sql with method=callable not returning int raising TypeError
- [x] closes #46891 (Replace xxxx with the Github issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added an entry in the latest `doc/source/whatsnew/v1.4.4.rst` file if fixing a bug or adding a new feature.

@mroeschke 1.4.3 is (i think) ready for release first thing tomorrow. I know nothing about sql so not reviewing. If this goes in, I should probably redo some pre-release checks. Not a problem. but would prefer not to have broken ci, broken release note links, manual backports needed etc. etc.. All these sap time waiting for the ci to complete. > @mroeschke 1.4.3 is (i think) ready for release first thing tomorrow. I know nothing about sql so not reviewing. If this goes in, I should probably redo some pre-release checks. Not a problem. but would prefer not to have broken ci, broken release note links, manual backports needed etc. etc.. All these sap time waiting for the ci to complete.

No problem. Will push to 1.4.4/1.5
 @meeseeksdev backport 1.4.x Could not push to auto-backport-of-pr-47474-on-1.4.x due to error, aborting.