Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Chigarev <[email protected]>
  • Loading branch information
dchigarev committed Nov 12, 2023
1 parent 068453d commit ac17c16
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions modin/core/dataframe/pandas/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def set_dtypes_cache(self, dtypes):
"""
dtypes = self._maybe_update_proxies(dtypes)
if dtypes is None and self.has_materialized_columns:
# try to set a descriptor instead of 'None' to be more flexible in
# dtypes computing
try:
self._dtypes = ModinDtypes(
DtypesDescriptor(
Expand Down
12 changes: 7 additions & 5 deletions modin/core/dataframe/pandas/metadata/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DtypesDescriptor:
One can't pass `know_all_names=False` together with `remaining_dtype` as this creates ambiguity
on how to interpret missing columns (whether they belong to `remaining_dtype` or not).
_schema_is_known : bool, optional
Whether `known_dtypes` describe all the columns in the dataframe. This parameter intended mostly
Whether `known_dtypes` describe all columns in the dataframe. This parameter intended mostly
for internal use.
"""

Expand All @@ -64,7 +64,7 @@ def __init__(
remaining_dtype: Optional[np.dtype] = None,
parent_df: Optional["PandasDataframe"] = None,
columns_order: Optional[dict[int, IndexLabel]] = None,
know_all_names=True,
know_all_names: bool = True,
_schema_is_known: Optional[bool] = None,
):
if not know_all_names and remaining_dtype is not None:
Expand All @@ -89,7 +89,7 @@ def __init__(
self._cols_with_unknown_dtypes: list[IndexLabel] = (
[] if cols_with_unknown_dtypes is None else cols_with_unknown_dtypes
)
# whether 'known_dtypes' describe all the columns in the dataframe
# whether 'known_dtypes' describe all columns in the dataframe
if _schema_is_known is None:
self._schema_is_known: bool = (
len(cols_with_unknown_dtypes) == 0
Expand All @@ -105,7 +105,7 @@ def __init__(
)
else:
self._schema_is_known: bool = _schema_is_known
self._know_all_names = know_all_names
self._know_all_names: bool = know_all_names
# a common dtype for columns that are not present in 'known_dtypes' nor in 'cols_with_unknown_dtypes'
self._remaining_dtype: Optional[np.dtype] = remaining_dtype
self._parent_df: Optional["PandasDataframe"] = parent_df
Expand Down Expand Up @@ -270,7 +270,9 @@ def copy(self) -> "DtypesDescriptor":
self._cols_with_unknown_dtypes.copy(),
self._remaining_dtype,
self._parent_df,
columns_order=self.columns_order,
columns_order=None
if self.columns_order is None
else self.columns_order.copy(),
know_all_names=self._know_all_names,
_schema_is_known=self._schema_is_known,
)
Expand Down
2 changes: 1 addition & 1 deletion modin/core/storage_formats/base/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4534,7 +4534,7 @@ def get_dtypes_set(self):
-------
set
"""
return set(self.dtypes.value)
return set(self.dtypes.values)

# DateTime methods
def between_time(self, **kwargs): # noqa: PR01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ def _maybe_update_proxies(self, dtypes, new_parent=None):
table = self._partitions[0][0].get()
if isinstance(table, pyarrow.Table):
return super()._maybe_update_proxies(dtypes, new_parent=table)
return dtypes

def groupby_agg(self, by, axis, agg, groupby_args, **kwargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tag_prefix =
parentdir_prefix = modin-

[tool:pytest]
addopts =
addopts = --cov-config=setup.cfg --cov=modin --cov-append --cov-report=
xfail_strict=true
markers =
xfail_executions
Expand Down

0 comments on commit ac17c16

Please sign in to comment.