Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Param use_default_schema does not work on package_search #2848

Merged
merged 1 commit into from Feb 17, 2016

Conversation

amercader
Copy link
Member

#1327 made both package_search and package_show return the validated data_dict instead of the default one. In both cases passing use_default_schema=True should allow to retrieve the unvalidated data_dict, but on package_search is returning an exception:

    response = fn(context, data)
  File "/home/adria/dev/pyenvs/flask/src/ckan/ckan/logic/__init__.py", line 416, in wrapped
    result = _action(context, data_dict, **kw)
  File "/home/adria/dev/pyenvs/flask/src/ckan/ckan/logic/action/get.py", line 1852, in package_search
    query.run(data_dict)
  File "/home/adria/dev/pyenvs/flask/src/ckan/ckan/lib/search/query.py", line 306, in run
    raise SearchQueryError("Invalid search parameters: %s" % invalid_params)
SearchQueryError: Invalid search parameters: ['use_default_schema']

That's because the param is not removed before being sent to Solr

The parameter needs to be removed before sending the query to Solr

Also improved the boolean checking and fixed the docs.
@wardi
Copy link
Contributor

wardi commented Jan 28, 2016

This looks obviously correct, but should we add a little test to make sure it stays working?

@wardi
Copy link
Contributor

wardi commented Feb 16, 2016

@amercader Ok I'll let the tests slide this time because it's a fix we need to backport...

wardi added a commit that referenced this pull request Feb 17, 2016
…_search

Param use_default_schema does not work on package_search
@wardi wardi merged commit 7079083 into master Feb 17, 2016
amercader added a commit that referenced this pull request Feb 22, 2016
amercader added a commit that referenced this pull request Feb 22, 2016
amercader added a commit that referenced this pull request Mar 16, 2016
The parameter needs to be removed before sending the query to Solr

Also improved the boolean checking and fixed the docs.
amercader added a commit that referenced this pull request Mar 16, 2016
The parameter needs to be removed before sending the query to Solr

Also improved the boolean checking and fixed the docs.
amercader added a commit that referenced this pull request Mar 16, 2016
The parameter needs to be removed before sending the query to Solr

Also improved the boolean checking and fixed the docs.

Conflicts:
	ckan/logic/action/get.py
@smotornyuk smotornyuk deleted the 2848-fix-default-schema-on-package_search branch December 19, 2018 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants