Skip to content

Commit

Permalink
import_.py - skip Could not find value None to avoid shortening of me…
Browse files Browse the repository at this point in the history
…ssages
  • Loading branch information
sjib committed May 12, 2024
1 parent 7f38106 commit 06699fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qgepqwat2ili/qgepdss/import_.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ def get_vl_instance(vl_table, value):
# TODO : return "other" (or other applicable value) rather than None, or even throwing an exception, would probably be better
row = qgep_session.query(vl_table).filter(vl_table.value_de == value).first()
if row is None:
logger.warning(
f'Could not find value `{value}` in value list "{vl_table.__table__.schema}.{vl_table.__name__}". Setting to None instead.'
# 12.5.2024 write logger.warning only if value is not None
if value != None:
logger.warning(
f'Could not find value `{value}` in value list "{vl_table.__table__.schema}.{vl_table.__name__}". Setting to None instead.'
)
)
return None
return row
Expand Down

0 comments on commit 06699fa

Please sign in to comment.