Misc documentation and name tweaks before release

This commit is contained in:
Seth Michael Larson 2020-08-17 12:49:37 -05:00 committed by Seth Michael Larson
parent 66b24f9e8a
commit 46533ede98
4 changed files with 12 additions and 6 deletions

View File

@ -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})"

View File

@ -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"
)

View File

@ -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(

View File

@ -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: