Open
Description
Current Behavior
I've selected the wrong primary keys in value diff and the server crashed.
logs:
Future exception was never retrieved
future: <Future finished exception=RecceException('Invalid primary key: date_year. The column should be unique. Please check by this sql: \'\n\nselect\n date_year as unique_field,\n count(*) as n_records\n\nfrom "live"."sponsored_collections"."partner_revenue_status_changes_yearly"\nwhere date_year is not null\ngroup by date_year\nhaving count(*) > 1\n\n\'')>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.10/site-packages/recce/apis/run_func.py", line 139, in fn
raise e
File "/usr/local/lib/python3.10/site-packages/recce/apis/run_func.py", line 132, in fn
result = task.execute()
File "/usr/local/lib/python3.10/site-packages/recce/tasks/valuediff.py", line 230, in execute
self._verify_primary_key(dbt_adapter, primary_key, model)
File "/usr/local/lib/python3.10/site-packages/recce/tasks/valuediff.py", line 71, in _verify_primary_key
raise RecceException(
recce.exceptions.RecceException: Invalid primary key: date_year. The column should be unique. Please check by this sql: '
select
date_year as unique_field,
count(*) as n_records
from "live"."sponsored_collections"."partner_revenue_status_changes_yearly"
where date_year is not null
group by date_year
having count(*) > 1
'
./run-scripts/start-recce.sh: line 40: 12986 Killed recce server --host "$RECCE_SERVER_HOST" --port "$RECCE_SERVER_PORT"
make: *** [makefile:95: start-recce] Error 137
/usr/local/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 4 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '
Expected Behavior
I'd expect an error message instead and then the ability to select again. Potentially showing me a sample of the duplicate values and a query I can use to double check.
Steps To Reproduce
- I started recce locally (v.054) and opened the UI
- On lineage the changed model was already selected
- navigated to explore change > value diff
- selected the wrong primary keys
- server crashes
Relevant log output
Environment
- recce: 0.54
- OS: MacOS 15.3.1
- Python: 3.10.16
- Data Warehouse: aws redshift
- dbt: 1.8.3
Additional Context
No response