Skip to content

Commit

Permalink
sed
Browse files Browse the repository at this point in the history
  • Loading branch information
noloerino committed Aug 14, 2024
1 parent 7428c39 commit afe692c
Show file tree
Hide file tree
Showing 18 changed files with 443 additions and 443 deletions.
2 changes: 1 addition & 1 deletion modin/distributed/dataframe/pandas/partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,4 @@ def from_partitions(
if labels_axis_to_sync != -1:
frame.synchronize_labels(axis=labels_axis_to_sync)

return DataFrame(query_compiler=PandasQueryCompiler(frame))
return DataFrame(data=PandasQueryCompiler(frame))
2 changes: 1 addition & 1 deletion modin/experimental/batch/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def compute_batch(
column_widths=list(map(len, internal_cols)),
)
query_compiler = PandasQueryCompiler(result_modin_frame)
result_df = pd.DataFrame(query_compiler=query_compiler)
result_df = pd.DataFrame(data=query_compiler)
final_results[id] = result_df

return final_results
18 changes: 9 additions & 9 deletions modin/experimental/pandas/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def read_sql(

result = FactoryDispatcher.read_sql_distributed(**kwargs)
if isinstance(result, BaseQueryCompiler):
return DataFrame(query_compiler=result)
return (DataFrame(query_compiler=qc) for qc in result)
return DataFrame(data=result)
return (DataFrame(data=qc) for qc in result)


@expanduser_path_arg("filepath_or_buffer")
Expand Down Expand Up @@ -160,7 +160,7 @@ def read_custom_text(

from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher

return DataFrame(query_compiler=FactoryDispatcher.read_custom_text(**kwargs))
return DataFrame(data=FactoryDispatcher.read_custom_text(**kwargs))


# CSV and table
Expand Down Expand Up @@ -292,11 +292,11 @@ def _read(**kwargs) -> DataFrame:
if isinstance(pd_obj, pandas.io.parsers.TextFileReader):
reader = pd_obj.read
pd_obj.read = lambda *args, **kwargs: DataFrame(
query_compiler=reader(*args, **kwargs)
data=reader(*args, **kwargs)
)
return pd_obj

return DataFrame(query_compiler=pd_obj)
return DataFrame(data=pd_obj)


read_csv_glob = _make_parser_func(sep=",", funcname="read_csv_glob")
Expand Down Expand Up @@ -344,7 +344,7 @@ def read_pickle_glob(

from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher

return DataFrame(query_compiler=FactoryDispatcher.read_pickle_glob(**kwargs))
return DataFrame(data=FactoryDispatcher.read_pickle_glob(**kwargs))


@expanduser_path_arg("filepath_or_buffer")
Expand Down Expand Up @@ -432,7 +432,7 @@ def read_parquet_glob(
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher

return DataFrame(
query_compiler=FactoryDispatcher.read_parquet_glob(
data=FactoryDispatcher.read_parquet_glob(
path=path,
engine=engine,
columns=columns,
Expand Down Expand Up @@ -531,7 +531,7 @@ def read_json_glob(
)

return DataFrame(
query_compiler=FactoryDispatcher.read_json_glob(
data=FactoryDispatcher.read_json_glob(
path_or_buf=path_or_buf,
orient=orient,
typ=typ,
Expand Down Expand Up @@ -641,7 +641,7 @@ def read_xml_glob(
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher

return DataFrame(
query_compiler=FactoryDispatcher.read_xml_glob(
data=FactoryDispatcher.read_xml_glob(
path_or_buffer=path_or_buffer,
xpath=xpath,
namespaces=namespaces,
Expand Down
56 changes: 28 additions & 28 deletions modin/pandas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def abs(self) -> Self: # noqa: RT01, D200
Return a `BasePandasDataset` with absolute numeric value of each element.
"""
self._validate_dtypes(numeric_only=True)
return self.__constructor__(query_compiler=self._query_compiler.abs())
return self.__constructor__(data=self._query_compiler.abs())

def _set_index(self, new_index) -> None:
"""
Expand Down Expand Up @@ -853,8 +853,8 @@ def align(
fill_axis=fill_axis,
broadcast_axis=broadcast_axis,
)
return self.__constructor__(query_compiler=left), self.__constructor__(
query_compiler=right
return self.__constructor__(data=left), self.__constructor__(
data=right
)

@abc.abstractmethod
Expand Down Expand Up @@ -1016,7 +1016,7 @@ def asfreq(
Convert time series to specified frequency.
"""
return self.__constructor__(
query_compiler=self._query_compiler.asfreq(
data=self._query_compiler.asfreq(
freq=freq,
method=method,
how=how,
Expand Down Expand Up @@ -1276,8 +1276,8 @@ def copy(self, deep=True) -> Self: # noqa: PR01, RT01, D200
Make a copy of the object's metadata.
"""
if deep:
return self.__constructor__(query_compiler=self._query_compiler.copy())
new_obj = self.__constructor__(query_compiler=self._query_compiler)
return self.__constructor__(data=self._query_compiler.copy())
new_obj = self.__constructor__(data=self._query_compiler)
self._add_sibling(new_obj)
return new_obj

Expand Down Expand Up @@ -1308,7 +1308,7 @@ def cummax(
return self.__constructor__(
# FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility
# purpose and does not affect the result, we shouldn't pass them to the query compiler.
query_compiler=self._query_compiler.cummax(
data=self._query_compiler.cummax(
fold_axis=axis, axis=axis, skipna=skipna, **kwargs
)
)
Expand All @@ -1325,7 +1325,7 @@ def cummin(
return self.__constructor__(
# FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility
# purpose and does not affect the result, we shouldn't pass them to the query compiler.
query_compiler=self._query_compiler.cummin(
data=self._query_compiler.cummin(
fold_axis=axis, axis=axis, skipna=skipna, **kwargs
)
)
Expand All @@ -1341,7 +1341,7 @@ def cumprod(
return self.__constructor__(
# FIXME: Judging by pandas docs `**kwargs` serves only compatibility
# purpose and does not affect the result, we shouldn't pass them to the query compiler.
query_compiler=self._query_compiler.cumprod(
data=self._query_compiler.cumprod(
fold_axis=axis, axis=axis, skipna=skipna, **kwargs
)
)
Expand All @@ -1357,7 +1357,7 @@ def cumsum(
return self.__constructor__(
# FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility
# purpose and does not affect the result, we shouldn't pass them to the query compiler.
query_compiler=self._query_compiler.cumsum(
data=self._query_compiler.cumsum(
fold_axis=axis, axis=axis, skipna=skipna, **kwargs
)
)
Expand Down Expand Up @@ -1397,7 +1397,7 @@ def describe(
# Match pandas error from concatenting empty list of series descriptions.
raise ValueError("No objects to concatenate")
return self.__constructor__(
query_compiler=data._query_compiler.describe(percentiles=percentiles)
data=data._query_compiler.describe(percentiles=percentiles)
)

def diff(self, periods=1, axis=0) -> Self: # noqa: PR01, RT01, D200
Expand All @@ -1415,7 +1415,7 @@ def diff(self, periods=1, axis=0) -> Self: # noqa: PR01, RT01, D200

axis = self._get_axis_number(axis)
return self.__constructor__(
query_compiler=self._query_compiler.diff(axis=axis, periods=periods)
data=self._query_compiler.diff(axis=axis, periods=periods)
)

def drop(
Expand Down Expand Up @@ -1588,7 +1588,7 @@ def drop_duplicates(
result_qc = self._query_compiler.unique(
keep=keep, ignore_index=ignore_index, subset=subset
)
result = self.__constructor__(query_compiler=result_qc)
result = self.__constructor__(data=result_qc)
if inplace:
self._update_inplace(result._query_compiler)
else:
Expand All @@ -1607,7 +1607,7 @@ def explode(
Transform each element of a list-like to a row.
"""
exploded = self.__constructor__(
query_compiler=self._query_compiler.explode(column)
data=self._query_compiler.explode(column)
)
if ignore_index:
exploded = exploded.reset_index(drop=True)
Expand Down Expand Up @@ -1984,7 +1984,7 @@ def convert_dtypes(
Convert columns to best possible dtypes using dtypes supporting ``pd.NA``.
"""
return self.__constructor__(
query_compiler=self._query_compiler.convert_dtypes(
data=self._query_compiler.convert_dtypes(
infer_objects=infer_objects,
convert_string=convert_string,
convert_integer=convert_integer,
Expand All @@ -2003,7 +2003,7 @@ def isin(self, values) -> Self: # noqa: PR01, RT01, D200
ignore_indices = isinstance(values, Series)
values = getattr(values, "_query_compiler", values)
return self.__constructor__(
query_compiler=self._query_compiler.isin(
data=self._query_compiler.isin(
values=values, ignore_indices=ignore_indices
)
)
Expand All @@ -2012,7 +2012,7 @@ def isna(self) -> Self: # noqa: RT01, D200
"""
Detect missing values.
"""
return self.__constructor__(query_compiler=self._query_compiler.isna())
return self.__constructor__(data=self._query_compiler.isna())

isnull: Self = isna

Expand Down Expand Up @@ -2253,7 +2253,7 @@ def mode(
"""
axis = self._get_axis_number(axis)
return self.__constructor__(
query_compiler=self._query_compiler.mode(
data=self._query_compiler.mode(
axis=axis, numeric_only=numeric_only, dropna=dropna
)
)
Expand All @@ -2280,7 +2280,7 @@ def notna(self) -> Self: # noqa: RT01, D200
"""
Detect existing (non-missing) values.
"""
return self.__constructor__(query_compiler=self._query_compiler.notna())
return self.__constructor__(data=self._query_compiler.notna())

notnull: Self = notna

Expand Down Expand Up @@ -2336,7 +2336,7 @@ def pct_change(
raise TypeError(f"unsupported operand type for /: got {dtype}")

return self.__constructor__(
query_compiler=self._query_compiler.pct_change(
data=self._query_compiler.pct_change(
periods=periods,
fill_method=fill_method,
limit=limit,
Expand Down Expand Up @@ -2412,7 +2412,7 @@ def check_dtype(t):
axis = numeric_only_df._get_axis_number(axis)
if isinstance(q, (pandas.Series, np.ndarray, pandas.Index, list, tuple)):
return numeric_only_df.__constructor__(
query_compiler=numeric_only_df._query_compiler.quantile_for_list_of_values(
data=numeric_only_df._query_compiler.quantile_for_list_of_values(
q=q,
axis=axis,
# `numeric_only=True` has already been processed by using `self.drop` function
Expand Down Expand Up @@ -2452,7 +2452,7 @@ def rank(
)
axis = self._get_axis_number(axis)
return self.__constructor__(
query_compiler=self._query_compiler.rank(
data=self._query_compiler.rank(
axis=axis,
method=method,
numeric_only=numeric_only,
Expand Down Expand Up @@ -2795,7 +2795,7 @@ def round(self, decimals=0, *args, **kwargs) -> Self: # noqa: PR01, RT01, D200
# FIXME: Judging by pandas docs `*args` and `**kwargs` serves only compatibility
# purpose and does not affect the result, we shouldn't pass them to the query compiler.
return self.__constructor__(
query_compiler=self._query_compiler.round(decimals=decimals, **kwargs)
data=self._query_compiler.round(decimals=decimals, **kwargs)
)

def rpow(
Expand Down Expand Up @@ -2951,10 +2951,10 @@ def sample(
)
if axis:
query_compiler = self._query_compiler.getitem_column_array(samples)
return self.__constructor__(query_compiler=query_compiler)
return self.__constructor__(data=query_compiler)
else:
query_compiler = self._query_compiler.getitem_row_array(samples)
return self.__constructor__(query_compiler=query_compiler)
return self.__constructor__(data=query_compiler)

def sem(
self,
Expand Down Expand Up @@ -4119,7 +4119,7 @@ def __invert__(self) -> Self:
)
)
)
return self.__constructor__(query_compiler=self._query_compiler.invert())
return self.__constructor__(data=self._query_compiler.invert())

@_doc_binary_op(
operation="less than or equal comparison",
Expand Down Expand Up @@ -4182,7 +4182,7 @@ def __neg__(self) -> Self:
BasePandasDataset
"""
self._validate_dtypes(numeric_only=True)
return self.__constructor__(query_compiler=self._query_compiler.negative())
return self.__constructor__(data=self._query_compiler.negative())

def __nonzero__(self):
"""
Expand Down Expand Up @@ -4294,7 +4294,7 @@ def _repartition(self, axis: Optional[int] = None) -> Self:
f"Passed `axis` parameter: {axis}, but should be one of {allowed_axis_values}"
)
return self.__constructor__(
query_compiler=self._query_compiler.repartition(axis=axis)
data=self._query_compiler.repartition(axis=axis)
)

@disable_logging
Expand Down
Loading

0 comments on commit afe692c

Please sign in to comment.