DanCardin / sqlalchemy-declarative-extensions

Library to declare additional kinds of objects not natively supported by SqlAlchemy/Alembic.
https://sqlalchemy-declarative-extensions.readthedocs.io/en/latest/
Apache License 2.0
36 stars 7 forks source link

fix: Strip whitespace from SQL def before asserting starts with SELECT #102

Closed srohr closed 1 day ago

srohr commented 5 days ago

I'm seeing a failure in alembic revision --autogenerate due to leading whitespace in definition prior to the beginning of the SQL statement, i.e.

(Pdb) definition.startswith("SELECT")
False
(Pdb) definition[0:50]
'           SELECT amazon_dsp.line_item_creative_lo'
(Pdb) definition.strip().startswith("SELECT")
True