Skip to content

Releases: untergeek/es_client

8.15.2 (30 September 2024)

30 Sep 16:50
Compare
Choose a tag to compare

Changes

  • Python module version bumps:
    • elasticsearch8==8.15.1
    • pyyaml==6.0.2
    • certifi>=2024.8.30

8.15.1 (23 August 2024)

23 Aug 22:30
Compare
Choose a tag to compare

Changes

  • Added commands.py as both a cleaner location for the show_all_options
    function, as well as a place it could be imported and re-used.
  • Updated docs/example.rst and docs/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)

14 Aug 03:08
Compare
Choose a tag to compare

Changes

  • Python module version bumps:
    • elasticsearch8==8.15.0
  • Make execution scripts more consistent and PEP compliant.

8.14.2 (6 August 2024)

06 Aug 23:56
Compare
Choose a tag to compare

8.14.1, but with one fewer module still trying to import six

8.14.1 (6 August 2024)

06 Aug 23:30
Compare
Choose a tag to compare

Changes

  • six module removed.
  • Rolled back voluptuous to be >=0.14.2 to work with Python 3.8

8.13.4 (30 April 2024)

30 Apr 13:52
Compare
Choose a tag to compare

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 from docker_test/scripts to just docker_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)

03 Jul 21:36
Compare
Choose a tag to compare

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 API token 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)

07 May 21:55
Compare
Choose a tag to compare

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)

26 Apr 14:14
Compare
Choose a tag to compare

Changes

  • After all that work to ensure proper typing, I forgot to include the py.typed marker file.

8.13.2 (25 April 2024)

26 Apr 00:19
Compare
Choose a tag to compare

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 class Args to DotMap. 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 and Builder.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.