opensearch-project / opensearch-py-ml

Apache License 2.0
34 stars 64 forks source link

create_standalone_connector() should be create_connector() #396

Open rbpasker opened 4 months ago

rbpasker commented 4 months ago

there are two kinds of connectors: standalone and those bound to a specific model. The former uses this API, and the latter uses the Model API. Since they're in two different interfaces, this one is not ambiguous and should not need the word 'standalone' in the definition.

for backwards compatibility, i recommend adding @depricated to create_standalone_connector(), and then invoking create_connector():

    @deprecated("Use create_connector instead")
    def create_standalone_connector(self, payload: dict):
        return self.create_connector(**args, **kwargs)

https://github.com/opensearch-project/opensearch-py-ml/blob/ec7e0235d9092cb26fe3d889d8ab7fae28dccefe/opensearch_py_ml/ml_commons/model_connector.py#L17

dblock commented 3 months ago

Thanks for opening this @rbpasker, want to try and contribute the change as suggested?

[Catch All Triage w/ 1, 2, 3]