Open sjib opened 2 days ago
Locks similar to this stacklevel error we had before: https://github.com/teksi/wastewater/issues/172 and that was fixed
def truncate(self, val, max_length):
"""
Raises a warning if values gets truncated
"""
if val is None:
return None
if len(val) > max_length:
logger.warning(f"Value '{val}' exceeds expected length ({max_length})", stacklevel=2)
return val[0:max_length]
Or is it just creating too many logger.warnings and therefore overflows the variable {var} - what do you think @ponceta
@PeterZamudio and Sandro:
I can't figure out what's wrong with python but from what I see you have remark fields that are over the limit of 80 characters.
Maybe that's indeed the {val} or {max_length} which is creating trouble.
What I see here is that we have a warning which makes the application crash, this is not great in terms of stability.
@domi4484 add a unit test for this stacklevel argument in https://github.com/QGEP/qgepqwat2ili/pull/170#issuecomment-2421849552 so it should not fail so easily.
We should maybe create such errors in an INTERLIS and a demodata file (with and without errors) to check that the application is handling well these error scenarii as we did with QGEP.
Is that with the latest version of the plugin? looking at the line numbers in the stack trace I would say not
I tried with latest release and it works as expected :
2024-10-25T16:29:21 teksi_wastewater.utils:Value 'Alte Bezeichnung: SH1 AND a very very very very very ververy very very very very ververy very very very very ververy very very very very ververy very very very very very long remark' exceeds expected length (80)
Describe the bug A clear and concise description of what the bug is.
To Reproduce Exact steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Variable {val} exeeds expected lenght - creates error message with stacklevel, that is not supported
Screenshots / data If applicable, add screenshots or data to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.