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

New: Add parameter for a custom encoder #352

Merged
merged 1 commit into from
Oct 2, 2020

Conversation

ahankinson
Copy link
Contributor

@ahankinson ahankinson commented Oct 1, 2020

This commit adds a parameter to supply a custom JSON encoder for the JSON interface.

To avoid installing an extra dependency, a supplied test change simply changes it to check the default encoder. However, this has been tested locally with the ujson module and works fine:

solr_conn = pysolr.Solr("http://localhost:8983/solr/my-core", decoder=ujson, encoder=ujson)

This commit adds a parameter to supply a custom JSON encoder for the JSON interface.

To avoid installing an extra dependency, a supplied test change simply changes it to check the default encoder. However, this has been tested locally with the ujson module and works fine:

solr_conn = pysolr.Solr("http://localhost:8983/solr/my-core", decoder=ujson, encoder=ujson)
@codecov
Copy link

codecov bot commented Oct 1, 2020

Codecov Report

Merging #352 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #352   +/-   ##
=======================================
  Coverage   94.25%   94.26%           
=======================================
  Files           7        7           
  Lines        1340     1342    +2     
=======================================
+ Hits         1263     1265    +2     
  Misses         77       77           
Impacted Files Coverage Δ
pysolr.py 89.34% <100.00%> (+0.01%) ⬆️
tests/test_client.py 99.63% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c3a684...722200a. Read the comment docs.

@acdha acdha merged commit 1db2b1e into django-haystack:master Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants