Releases: untergeek/es_client
8.15.2 (30 September 2024)
8.15.1 (23 August 2024)
Changes
- Added
commands.py
as both a cleaner location for theshow_all_options
function, as well as a place it could be imported and re-used. - Updated
docs/example.rst
anddocs/tutorial.rst
to reflect these
location changes. - Updated
pytest.ini
to automatically look for and use.env
for
environment variables for testing. - Using versioned
docker_test
scripts now from
https://github.com/untergeek/es-docker-test-scripts
8.15.0 (13 August 2024)
Changes
- Python module version bumps:
elasticsearch8==8.15.0
- Make execution scripts more consistent and PEP compliant.
8.14.2 (6 August 2024)
8.14.1, but with one fewer module still trying to import six
8.14.1 (6 August 2024)
Changes
six
module removed.- Rolled back
voluptuous
to be>=0.14.2
to work with Python 3.8
8.13.4 (30 April 2024)
Changes
- Updated
docker_test
scripts to enable TLS testing and better integration with pytest.
TEST_USER and TEST_PASS and TEST_ES_SERVER, etc. are all populated and put into.env
Even the CA certificate is copied to TEST_PATH, so it's easy for the tests to pick it up.
Not incidentally, the scripts were moved fromdocker_test/scripts
to justdocker_test
.
The tutorial in the documentation has been updated to reflect these changes. - Added
pytest-dotenv
as a test dependency to take advantage of the.env
- Minor code formatting in most files as I've switched to using
black
with VS Code, and
flake8, and mypy.
Bugfix
- Found 1 stray instance of
update_settings
from before the DotMap switch. Fixed.
8.14.0 (3 July 2024)
Changes
- Python module version bumps:
elasticsearch8==8.14.0
ecs-logging==2.2.0
voluptuous>=0.15.2
certifi>=2024.6.2
- Updated remainint tests to Pytest-style formatting.
- Updated
docker_test
scripts to most recent updates.
Bugfix
- Fixed an error reported at elastic/curator#1713
where providing an empty APItoken
key would still result in the Builder
class method_check_api_key
trying to extract data. Locally tracked at
#66
8.13.5 (7 May 2024)
Changes
- Version bump for
elasticsearch8==8.13.1
- Code formatting changes (cleanup of lines over 88 chars, mostly).
- Added
.coveragerc
- Improved
docker_test
scripts and env var importing in tests.
Bugfix
- Discovered an instance where passwords were being logged. This has been corrected.
8.13.3 (26 April 2024)
Changes
- After all that work to ensure proper typing, I forgot to include the
py.typed
marker file.
8.13.2 (25 April 2024)
Changes
- Added typing hints, everywhere. Trying to make the module play nicer with others.
- Moved all code under
src/es_client
to be more package compliant. - Moved
__version__
to__init__.py
- Updated the
pyproject.toml
file to reflect these changes. - Updated tests and documentation as needed.
Potentially Breaking Changes
-
Migrated away from custom
dict
-to-attribute classArgs
toDotMap
. It's the best of
both worlds as it gives full dotted notation access to a dictionary, making it appear like
class attributes. But it also still affords you the ability to treat each nested field just like
a dictionary, still.Builder.client_args
andBuilder.other_args
should look and feel the
exact same as before, with one noted difference, and that is the.asdict()
method has been
replaced by the.toDict()
method. This is the one change that might mess you up. If you
are using that anywhere, please replace those calls. Also, if you were manually building these
objects before, rather than supplying a config file or dict, you can create these now as
follows:.. code-block:: python
from es_client import Builder from dotmap import DotMap client_settings = {} # Filled with your client settings client_args = DotMap(client_settings) builder = Builder() builder.client_args = client_args # Or directly assign: builder.client_args = DotMap(client_settings)
Updating a single key is simple:
.. code-block:: python
other_args = DotMap(other_settings) other_args.username = 'nobody' other_args['password'] = 'The Spanish Inquisition'
As noted, both dotted and dict formats are acceptable, as demonstrated above.
Updating with a dictionary of root level keys is simple:.. code-block:: python
other_settings = { 'master_only': False, 'username': 'original', 'password': 'oldpasswd', } other_args = DotMap(other_settings) # DotMap(master_only=False, username='original', password='oldpasswd') changes = { 'master_only': True, 'username': 'newuser', 'password': 'newpasswd', } other_args.update(changes) # DotMap(master_only=True, username='newuser', password='newpasswd')
If putting a nested dictionary in place, you should convert it to a DotMap first:
.. code-block:: python
d = {'a':'A', 'b':{'c':'C', 'd':{'e':'E'}}} dm = DotMap(d) # DotMap(a='A', b=DotMap(c='C', d=DotMap(e='E'))) b = {'b':{'g':'G', 'h':{'i':'I'}}} dm.update(b) # DotMap(a='A', b={'g': 'G', 'h': {'i': 'I'}}) # ^^^ # Not a DotMap dm.update(DotMap(b)) DotMap(a='A', b=DotMap(g='G', h=DotMap(i='I')))
It's always safest to update with a DotMap rather than a bare dict.
That's about it.