Describe the bug
With the introduction of dbt State both core and Platform projects introduce a new model run status – "reused". This status occurs whenever a model is reused due to no data or code changes.
When a model run status like this occurs, upon running an edr CLI command such as edr monitor, the following error occurs:
return [
^
File "/usr/local/lib/python3.11/site-packages/elementary/monitor/api/alerts/alert_filters.py", line 94, in <listcomp>
alert for alert in alerts if apply_filters_schema_on_alert(alert, alerts_filter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/elementary/monitor/api/alerts/alert_filters.py", line 53, in apply_filters_schema_on_alert
status = Status(alert.data.status)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 714, in __call__
return cls.__new__(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 1137, in __new__
raise ve_exc
ValueError: 'reused' is not a valid Status
To Reproduce
Steps to reproduce the behavior:
- Run a dbt project with Elementary enabled and dbt State enable. Make sure at least one model is reused
- Run
edr monitor from the command line after the project runs.
Expected behavior
edr monitor runs successfully.
Screenshots
Repeat error from above:
return [
^
File "/usr/local/lib/python3.11/site-packages/elementary/monitor/api/alerts/alert_filters.py", line 94, in <listcomp>
alert for alert in alerts if apply_filters_schema_on_alert(alert, alerts_filter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/elementary/monitor/api/alerts/alert_filters.py", line 53, in apply_filters_schema_on_alert
status = Status(alert.data.status)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 714, in __call__
return cls.__new__(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 1137, in __new__
raise ve_exc
ValueError: 'reused' is not a valid Status
Environment (please complete the following information):
- Elementary CLI (edr) version:
elementary-data[snowflake]==0.25.1 (latest)
- Elementary dbt package version:
0.25.1
- dbt version you're using:
1.11.12
- Data warehouse:
snowflake
Additional context
I believe this should be an easy fix by simply adding another enum variant here
Example Change
class Status(str, Enum):
WARN = "warn"
FAIL = "fail"
SKIPPED = "skipped"
ERROR = "error"
RUNTIME_ERROR = "runtime error"
PARTIAL_SUCCESS = "partial success"
REUSED = "reused"
I have not tested this yet, but after a quick code scan, I don't believe this should break any existing behavior.
Would you be willing to contribute a fix for this issue?
Let us know if you're willing to contribute so that we'll be able to provide guidance.
I am willing to put in a fix for this. I have already contributed to the elementary-data/dbt-data-reliability package.
Describe the bug
With the introduction of dbt State both core and Platform projects introduce a new model run status – "reused". This status occurs whenever a model is reused due to no data or code changes.
When a model run status like this occurs, upon running an
edrCLI command such asedr monitor, the following error occurs:To Reproduce
Steps to reproduce the behavior:
edr monitorfrom the command line after the project runs.Expected behavior
edr monitorruns successfully.Screenshots
Repeat error from above:
Environment (please complete the following information):
elementary-data[snowflake]==0.25.1(latest)0.25.11.11.12snowflakeAdditional context
I believe this should be an easy fix by simply adding another enum variant here
Example Change
I have not tested this yet, but after a quick code scan, I don't believe this should break any existing behavior.
Would you be willing to contribute a fix for this issue?
Let us know if you're willing to contribute so that we'll be able to provide guidance.
I am willing to put in a fix for this. I have already contributed to the elementary-data/dbt-data-reliability package.