Skip to content
Advertisement

SQLAlchemy Column Types As Generic (BIT Type)

I am trying to list out the columns of each table in an MSSQL database. I can get them fine, but I need to turn them into generic types for use elsewhere. (Python types would be more ideal but not sure how to do that?)

My code so far works until I come across a BIT type column.

I get the error:

NotImplementedError: Default TypeEngine.as_generic() heuristic method was unsuccessful for sqlalchemy.dialects.mssql.base.BIT. A custom as_generic() method must be implemented for this type class.

I have tried a number of things to work around this, but I’d like to learn what I need to do to fix it properly.

Can I make a custom method that turns BIT to INTEGER? And if so how can I implement it?

Thanks,

Advertisement

Answer

Solved. Was a bug, see comments on first post.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement