fix: use .values("id").distinct().count() in platform_hub for Oracle compatibility#7041
Conversation
The three distinct().count() queries in get_summary() fail on Oracle
with ORA-00932 because FFAdminUser has TextField columns that Oracle
maps to NCLOB, which cannot be used in SELECT DISTINCT. Using
.values("id").distinct().count() generates SELECT DISTINCT on just
the PK column, avoiding the NCLOB issue while producing identical
results.
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.
Once credits are available, reopen this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7041 +/- ##
=======================================
Coverage 98.33% 98.33%
=======================================
Files 1337 1337
Lines 50010 50010
=======================================
Hits 49178 49178
Misses 832 832 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Fix three
distinct().count()queries inplatform_hub/services.pythat fail on Oracle withORA-00932: inconsistent datatypes: expected - got NCLOB.FFAdminUserhasTextFieldcolumns (e.g.onboarding_data) which Oracle maps to NCLOB — Oracle cannot performSELECT DISTINCTon NCLOB columns. Using.values("id").distinct().count()generatesSELECT DISTINCT "id"instead ofSELECT DISTINCT *, avoiding the NCLOB column while producing identical results sinceidis the primary key.How did you test this code?