fix(api): use SPARQLWrapper.setMethod() for POST requests - #82
fix(api): use SPARQLWrapper.setMethod() for POST requests#82prathamesh04 wants to merge 2 commits into
Conversation
The SPARQLWrapper library does not expose .method as a settable public
attribute. Direct assignment (sparql.method = 'POST') is silently
ignored, causing all SPARQL queries to use GET instead of POST.
This fix uses the correct API: sparql.setMethod('POST').
Fixes dbpedia#69
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe SPARQL endpoint query now calls ChangesSPARQL POST method fix
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@databusclient/api/download.py`:
- Line 598: Update the fallback DummySPARQL in tests/conftest.py to implement
setMethod and store the supplied HTTP method, matching the production call used
by _query_sparql_endpoint. Preserve the existing test-double behavior while
preventing AttributeError when the real SPARQL dependency is unavailable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c84435f2-faf0-459e-8e54-919160f83453
📒 Files selected for processing (1)
databusclient/api/download.py
|
cc @Integer-Ctrl @DhanashreePetare @JJ-Author This PR fixes the SPARQL POST method bug (Issue #69). The current code uses which is silently ignored by SPARQLWrapper. This fix uses the correct API: . |
|
Hey @Integer-Ctrl @DhanashreePetare @JJ-Author — I've added a testing video demonstrating the fix working against a local SPARQL endpoint (Apache Jena Fuseki). The fix replaces the silently-ignored |
Description
The SPARQLWrapper library does not expose as a settable public attribute. Direct assignment () is silently ignored, causing all SPARQL queries to use GET instead of POST.
This fix uses the correct API: .
Changes
Testing
Fixes #69
Summary by CodeRabbit