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

Projects
None yet
2 participants
@amercader
Copy link
Member

commented Jan 27, 2016

#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

[#2848] Avoid package_search exception when using use_default_schema
The parameter needs to be removed before sending the query to Solr

Also improved the boolean checking and fixed the docs.
@wardi

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2016

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

@wardi

This comment has been minimized.

Copy link
Contributor

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

Merge pull request #2848 from ckan/2848-fix-default-schema-on-package…
…_search

Param use_default_schema does not work on package_search

@wardi wardi merged commit 7079083 into master Feb 17, 2016

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

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

[#2848] Avoid package_search exception when using use_default_schema
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

[#2848] Avoid package_search exception when using use_default_schema
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

[#2848] Avoid package_search exception when using use_default_schema
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 Dec 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.