olirice / alembic_utils

An alembic/sqlalchemy extension for migrating sql views, functions, triggers, and policies
https://olirice.github.io/alembic_utils
MIT License
211 stars 43 forks source link

Fix "reference before assignment" error when logging ignored entities #42

Closed mattinbits closed 3 years ago

mattinbits commented 3 years ago

This only causes an error when the earlier for entity in ordered_entities: does not create a variable named entity (i.e. when there are not yet any replaceable entities in the project). However even in the case where it doesn't throw an error, it will log erroneous information (because it is referencing entity rather than db_entity which is the object being considered).

codecov-commenter commented 3 years ago

Codecov Report

Merging #42 (c6baff0) into master (a1060ee) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #42   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          787       787           
=========================================
  Hits           787       787           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/alembic_utils/replaceable_entity.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a1060ee...c6baff0. Read the comment docs.

olirice commented 3 years ago

thank you the fix is available in alembic_utils==0.5.5