Commit 4d43ac5
Fix combined query column ambiguity error
BUG FIX: Resolve "Ambiguous reference to column name" error in get_samples_at_geo_cord_location_via_sample_event()
Problem:
- Query requested s.description, s.thumbnail_url, s.alternate_identifiers
- These columns don't exist on MaterialSampleRecord nodes
- thumbnail_url exists on both 'event' and 'site' tables, causing ambiguity
- Query was failing silently, returning empty array []
Solution:
- Use only columns that exist on MaterialSampleRecord: pid, label, name
- Add event.pid to match Path 1/2 queries
- Remove thumbnail_url sorting (column doesn't exist on samples)
- Simplify ORDER BY to just sample_label
Testing:
- Verified Path 1 and Path 2 queries work (they use correct columns)
- Error found via browser console: document.getElementById('loading_combined').innerHTML
- Error was: "Binder Error: Ambiguous reference to column name 'thumbnail_url'"
Changes:
- Removed: s.description, s.thumbnail_url, s.alternate_identifiers
- Added: s.name, event.pid (matching working queries)
- Updated documentation to reflect actual returned columns
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 1e4a473 commit 4d43ac5
1 file changed
+10
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
352 | | - | |
353 | | - | |
| 351 | + | |
354 | 352 | | |
| 353 | + | |
355 | 354 | | |
356 | 355 | | |
357 | 356 | | |
| |||
373 | 372 | | |
374 | 373 | | |
375 | 374 | | |
376 | | - | |
377 | | - | |
378 | | - | |
| 375 | + | |
379 | 376 | | |
| 377 | + | |
380 | 378 | | |
381 | 379 | | |
382 | 380 | | |
| |||
393 | 391 | | |
394 | 392 | | |
395 | 393 | | |
396 | | - | |
| 394 | + | |
397 | 395 | | |
398 | 396 | | |
399 | 397 | | |
| |||
697 | 695 | | |
698 | 696 | | |
699 | 697 | | |
700 | | - | |
| 698 | + | |
701 | 699 | | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
706 | 703 | | |
707 | 704 | | |
708 | | - | |
| 705 | + | |
709 | 706 | | |
710 | 707 | | |
711 | 708 | | |
| |||
0 commit comments