Coder Social home page Coder Social logo

[BUG] Missing type and settings parameters in _sync/snapshots & _async/snapshots create_respository methods about elasticsearch-py HOT 3 CLOSED

berglh avatar berglh commented on June 8, 2024
[BUG] Missing type and settings parameters in _sync/snapshots & _async/snapshots create_respository methods

from elasticsearch-py.

Comments (3)

pquentin avatar pquentin commented on June 8, 2024 1

There was no deprecation warning, you did everything right. I'll try to see how we can add one if we have to do this kind of change in the future.

from elasticsearch-py.

pquentin avatar pquentin commented on June 8, 2024

Hello! And sorry that elasticsearch-py 8.13 broke your workflow. This part of the code is generated from the elasticsearch-specification repository. The current representation was fine for Python which only exposes the first level (type and settings, not settings.endpoint) but caused issues in languages like Java, .NET, C# and JavaScript. elastic/elasticsearch-specification#2255 fixes those issues at the cost of breaking the compatibility with all 8.12 clients.

This means that while this worked in elasticsearch-py 8.12:

client.snapshot.create_repository(
    name="snapshot_name",
    verify=False,
    type="url",
    settings={
        "url": "file:/mount/backups/my_fs_backup_location",
    },
)

This is now needed in elasticsearch-py 8.13:

es.snapshot.create_repository(
    name="snapshot_name",
    verify=False,
    repository={
        "type": "url",
        "settings": {
            "url": "file:/mount/backups/my_fs_backup_location",
        },
    },
)

If you need something that works both in 8.12 and 8.13, you can use the body parameter instead:

es.snapshot.create_repository(
    name="snapshot_name",
    verify=False,
    body={
        "type": "url",
        "settings": {
            "url": "file:/mount/backups/my_fs_backup_location",
        },
    },
)

Sorry again that this breaks your workflow.

from elasticsearch-py.

berglh avatar berglh commented on June 8, 2024

@pquentin Thank-you for explaining the reasoning, it seems like a good project to standardise functionality across the various clients. I did receive a warning message on this method about using secrets in the payload instead of the Elasticsearch keystore, but I didn't ever see a deprecation warning in the Gitlab CI output for these parameters.

It would have been nice if we had some kind of heads up from the client about this change in advance, as I'm always looking at this output and looking for warnings/errors. I'm wondering if my inclusion of secrets masked that or if there was no deprecation warning. Either way, thanks for taking the time to point me in the right direction :)

from elasticsearch-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.