Fix multi fq breaking is_archived filter (follow-up) - #296
Open
Gutts-n wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Follow-up to PR #295 (merged, commit 79f02ac). That PR fixed the crash where combining multiple
fqparams corrupted the query, but the fix itself was incomplete._control_archived_datasets_visibilityinckanext/tdc/logic/action.pywas changed to append"-is_archived:(true)"as a new list element whenfqarrives as a list. That stopped the Python-level corruption, but CKAN core (ckan/lib/search/query.py) doesfq.append(query['fq'])when building the Solr query - it treats whatever is indata_dict['fq']as a single opaque clause, not something to iterate. So a listfqstill broke, just differently: Solr received the list's Python repr as one clause, e.g.which Solr rejected with the same class of parse error as before.
CKAN's
package_searchaction itself documentsfqas typestring(multi-filter is meant to go through the separatefq_listparam). So the correct fix is to normalizefqto a string, not a list.Fix
When
fqarrives as a list, join it into a space-separated string before appending the archived filter, sodata_dict['fq']is always a plain string by the time core sees it - matching what core actually expects.Verified
fq=organization:tumi&fq=geographies:ken) by temporarily pinning the staging build to this fix's commit.ckan/lib/search/query.pyandckan/logic/action/get.py(package_search) to confirm core expects a string, not a list.Deployment
No deploy-on-merge workflow found in this repo's
.github/workflows/. Staging'sCKANEXT_TDC_HASHinckan/Dockerfilewas temporarily bumped for testing during this investigation and has since been reset - this PR does not touch that pin, so merging it won't move the deployed hash on its own.