diff --git a/eland/arithmetics.py b/eland/arithmetics.py index 584fb0b..e8d923b 100644 --- a/eland/arithmetics.py +++ b/eland/arithmetics.py @@ -138,7 +138,7 @@ class ArithmeticSeries(ArithmeticObject): for task in self._tasks: if task.op_name == "__add__": value = f"({value} + {task.object.resolve()})" - elif task.op_name in ("__truediv__", "__div__"): + elif task.op_name in {"__truediv__", "__div__"}: value = f"({value} / {task.object.resolve()})" elif task.op_name == "__floordiv__": value = f"Math.floor({value} / {task.object.resolve()})" @@ -152,7 +152,7 @@ class ArithmeticSeries(ArithmeticObject): value = f"({value} - {task.object.resolve()})" elif task.op_name == "__radd__": value = f"({task.object.resolve()} + {value})" - elif task.op_name == "__rtruediv__": + elif task.op_name in {"__rtruediv__", "__rdiv__"}: value = f"({task.object.resolve()} / {value})" elif task.op_name == "__rfloordiv__": value = f"Math.floor({task.object.resolve()} / {value})" diff --git a/eland/ml/imported_ml_model.py b/eland/ml/imported_ml_model.py index 9129b81..215112a 100644 --- a/eland/ml/imported_ml_model.py +++ b/eland/ml/imported_ml_model.py @@ -198,7 +198,7 @@ class ImportedMLModel(MLModel): if es_if_exists not in ("fail", "replace"): raise ValueError("'es_if_exists' must be either 'fail' or 'replace'") elif es_if_exists == "fail": - if self.check_existing_model(): + if self.exists_model(): raise ValueError( f"Trained machine learning model {model_id} already exists" ) diff --git a/eland/ml/ml_model.py b/eland/ml/ml_model.py index bb93806..65646ae 100644 --- a/eland/ml/ml_model.py +++ b/eland/ml/ml_model.py @@ -58,9 +58,9 @@ class MLModel: except elasticsearch.NotFoundError: pass - def check_existing_model(self) -> bool: + def exists_model(self) -> bool: """ - Check If model exists in Elastic + Check if the model already exists in Elasticsearch """ try: self._client.ml.get_trained_models( diff --git a/eland/series.py b/eland/series.py index c1551dc..06cfa31 100644 --- a/eland/series.py +++ b/eland/series.py @@ -426,7 +426,13 @@ class Series(NDFrame): @property def dtype(self) -> np.dtype: - # DO NOT MAKE PUBLIC (i.e. def dtype) as this breaks query eval implementation + """ + Return the dtype object of the underlying data. + + See Also + -------- + :pandas_api_docs:`pandas.Series.dtype` + """ return self._query_compiler.dtypes[0] def __gt__(self, other: Union[int, float, "Series"]) -> BooleanFilter: