Commit Graph
615 Commits
Author SHA1 Message Date
umeandNick Lang 4e95fe320d Support renamed routing bulk parameter (#735) 2018-03-04 15:13:52 -08:00
Nick LangandGitHub 058d38f0ae Use use ssl_context or don't but don't mix (#714)
* Use original SSL process and add SSLContext

Not going to deprecate and replace with SSLContext.
But instead give option for using SSLContext next to the original way of
handling SSL.
2018-03-04 15:09:40 -08:00
Mike Sukmanowsky 197ad82e18 Use proper retry_on_conflict for helpers.expand_action
As per
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#bulk-update,
retry_on_conflict should not be preceeded by an underscore.
2018-02-13 12:06:29 -05:00
SlamandHonza Král 64202273e0 adds dynamic class-based repr (#713) 2018-01-24 15:21:29 +01:00
Honza Král eaa67a100d use_ssl flag is set by Connection
This wasn't an issue before as scheme=https was not documented but now
it is in the docs and it makes this entire block be skipped if url is
given without scheme and no ssl_context is passed completely breaking
ssl
2018-01-18 16:12:07 +01:00
Honza Král 57ec404ba3 Accurate description of TransportError.info
Fixes #710, thank you, @fbacchella, for the report!
2018-01-12 17:35:07 +01:00
Nick LangandGitHub 1cae2b7eb0 Merge pull request #695 from fbacchella/explicitly_typo
Typo in a comment.
2018-01-10 13:59:18 -07:00
Nick LangandGitHub 676e32809b Merge pull request #699 from ao/patch-1
Issue: 696 - crate should be corrected to create
2018-01-09 11:44:36 -07:00
Nick Lang ef08323d22 Bump to version 6.1.1 2018-01-05 19:51:20 -07:00
Andrew OdendaalandGitHub 90972e3983 Update transport.py 2018-01-05 13:50:52 +00:00
Andrew OdendaalandGitHub 3fd2c1a29d Issue: 696
`crate should be corrected to create.` as per https://github.com/elastic/elasticsearch-py/issues/696
2018-01-05 13:43:21 +00:00
Fabrice Bacchella b4a66c60a3 Typo in a comment. 2018-01-01 17:35:26 +01:00
Illia VolochiiandHonza Král 43ddb3d56b Dump as minified JSON as possible in its serializer (#658) 2018-01-01 16:08:38 +01:00
MatthieuandHonza Král 83a26ec78a fix python 3.5/6 warnings: [...]/elasticsearch/client/__init__.py:884: DeprecationWarning: invalid escape sequence \_ (#665)
https://bugs.python.org/issue27364
2018-01-01 16:07:22 +01:00
Fabrice BacchellaandHonza Král 8c13060c87 ImproperlyConfigured is imported but not used in transport. (#693) 2018-01-01 15:54:39 +01:00
Fabrice BacchellaandHonza Král 920218db83 Transport.perform_request mutate headers. (#694) 2018-01-01 15:54:09 +01:00
Honza Král a023bddb4d Use provided request headers in urllib3
outside. However, `Urllib3HttpConnection` did not use these headers but
only its default ones.

With this commit, `Urllib3HttpConnection` will either use the default
ones or merge the default headers with the provided ones if there are
any.

Relates #618
2018-01-01 15:42:46 +01:00
Nick Lang 456e598c5b moving import 2017-12-28 13:09:16 -07:00
Nick Lang bf1d64e88d Updates to SSL Context changes,
Bug with OSX made breaking changes to the way certifi was being imported
and used.

Unable to reproduce with Linux.

Found improper logic. Fixed now.
Also changing removing the flag for checking `verify_certs` as
it is `True` by default. Don't want to make users flag that as
`False` just to make things work.

A connection to an SSL instance should be:

    es = Elasticsearch("https://host:port", http_auth=(user,pass))

* If using Elastic Cloud or some other publicly recognized certificate
  that certifi can recognize.
2017-12-27 20:26:23 -07:00
Fabrice BacchellaandHonza Král 966f689545 A connection should be marked live with HEAD too. (#688) 2017-12-27 15:02:30 -05:00
Marco CovaandMarco Cova 7599a248ca fix typo in comment (minor) 2017-12-04 15:07:48 +00:00
Nick LangandHonza Král 37490e223f When _just_ using an SSL context we don't want breaking behavior (#673)
Also don't want to break backwards compat. So when chcking for depreicated values ignore
the check on verify_certs. Since it's True. the verify certs will be default true
in the ssl_context. And can be turned off in the SSL context when using it.
2017-11-28 22:01:20 +01:00
konradkonradandGitHub 9b288a1e92 docstring typo fixes
cheers
2017-11-16 17:07:57 +01:00
Honza Král f639f9b28e Apply cafile defaults before checking for emptiness
Fixes #669
2017-11-14 19:20:15 +01:00
Honza Král d9fa510fa6 Bump version to 6.1.0-dev 2017-11-14 15:27:59 +01:00
Honza Král 4e6a05f614 Added scroll_kwargs to scan helper 2017-11-10 21:43:16 +01:00
Honza Král 562c8c6146 Bump master to 6.0.0 2017-11-10 14:38:08 +01:00
Honza Král 92763522a9 Check successful shards instead of failed
Fixes #660, thanks @juke1
2017-11-09 20:35:53 +01:00
Patryk KrawaczyńskiandGitHub b79364f0b8 Unrecognized parameter: wait_for_merge
```
curl -XPOST 'http://es:9200/index/_forcemerge?flush=true&wait_for_merge=true&ignore_unavailable=true&max_num_segments=1'
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/lindex/_forcemerge] contains unrecognized parameter: [wait_for_merge]"}],"type":"illegal_argument_exception","reason":"request [/index/_forcemerge] contains unrecognized parameter: [wait_for_merge]"},"status":400}
```
2017-11-03 14:57:56 +01:00
Patryk KrawaczyńskiandHonza Král 961f6b54b3 Update tasks API (#659)
* Update cat.py

* Update tasks.py
2017-10-26 14:51:37 +02:00
Glen SmithandHonza Král cfec19afd8 Add bytes param to cat.shards and cat.segments (#654) 2017-10-11 22:16:50 +02:00
broono 12be146e45 Fix: AttributeError: 'bytes' object has no attribute 'encode'(PY3) 2017-10-09 13:47:36 +08:00
Nick LangandGitHub 5c537deca4 Merge pull request #635 from fxdgear/nick/ssl_context
Nick/ssl context
2017-10-06 11:35:23 -06:00
Nick Lang 7339a272b5 Add SSL context for versions of Python that support SSL Context.
Instead of passing parameters manually, you can construct an SSL
context. This allows for greater flexibility in using self signed certs.
2017-10-06 11:27:15 -06:00
Joshua Carp 3045516738 Clean up custom headers. 2017-10-04 16:07:55 -04:00
Joshua Carp 073db90ae8 Set application/x-ndjson content type on bulk requests.
Resolves #609
2017-10-04 16:07:55 -04:00
Glen Smith 392aedda5d Remove occurrences of non-ASCII chars from docs 2017-08-23 19:33:32 +02:00
Tyler James HardenandHonza Král cd769b98a5 Additional fixes for UTF-8 surrogate escapes (#629)
* Fixes non UTF-8 surrogateescapes 

Surrogate escapes in Unicode (non UTF-8 encoding) will be properly escaped with backslashes when encountered, versus breaking the transport layer.

* Removes erroneous bytes decode and reraises

Fixes to re-raise exceptions with different reasons
Removes erroneous bytes decode where bytes are desired

* Adds test for surrogate escapes in body

Tests that a surrogate escape sequence is properly escaped
with backslashes to produce valid UTF-8.

* Use proper byte sequence for surrogate

* Use if/else versus pass

* Proper Unicode surrogate escape

Use a Unicode Surrogate that properly escapes in both Python2 and Python3

* Passing test once surrogatepass is used

Updating test to pass once surrogatepass is used

* Use surrogatepass instead of backslashreplace

This replicates behavior between Python 2 and Python 3

* Fixes whitespace

* Simplifies with no exception block

Since `surrogatepass` will only ever explicitly occur when there are surrogate bytes encountered, there is no need to let the error throw and catch it, also uses single-quotes for consistency.

* Fixes Unicode Surrogate Escapes in request logging

This is the same fix as accepted for ElasticSearch requests, except applied to the request logging mechanisms.
2017-08-15 15:41:32 +01:00
Nick LangandGitHub 843ce9ee24 Merge pull request #628 from fxdgear/nick/fix_encode_error
better handling of bytestrings in _escape
2017-08-08 14:13:21 -06:00
Nick Lang a5b228a26d better handling of bytestrings in _escape
Fixes #627
2017-08-08 12:50:04 -06:00
Honza Král 3be98b0a09 first pass for 6.0 compatibility 2017-07-31 19:17:52 -04:00
Honza Král 95cf68a0bc Merge branch 'backoff' 2017-07-24 13:07:55 -04:00
Honza Král 8f73594cac Tests for retry logic in streaming_bulk 2017-07-22 13:40:22 -04:00
Honza Král ba8772a66f When retrying we get deserialized data
This is just a hotfix until a better solution with proper tests come
along
2017-07-22 13:13:53 -04:00
Honza Král 2c0f6d8c04 refactor the helpers a bit for more consistent errors
Now every error (either returned by streaming_bulk or collected by bulk)
contains the original data as well
2017-07-20 13:53:23 -04:00
Honza Král a16679b2cf draft of docs for backoff helper 2017-07-18 18:08:00 -04:00
Honza Král b31b5ddae6 Merged backoff into streaming_bulk 2017-07-18 17:44:43 -04:00
Honza Král 66c380420f Forgot to assign data 2017-07-18 16:20:36 -04:00
Honza Král 957fcad34b Do not serialize the data in bulk_data
This can lead to multiple serializations when retrying with backoff
helper
2017-07-18 16:15:08 -04:00
Honza Král accb19ab90 Action must be a dict, not serialized string 2017-07-18 15:45:43 -04:00