modin.pandas.explain_switch

modin.pandas.explain_switch(simple=True) Optional[DataFrame][source]

Shows a log of all backend switching decisions made by Snowpark pandas.

Display information where Snowpark pandas considered switching execution backends. There can be multiple switch decisions per line of code. The output of this method may change in the future and this is to be used for debugging purposes.

“source” is the user code where the switch point occurred, if it is available. “api” is the top level api call which initiated the switch point. “mode” is either “merge” for decisions involving multiple DataFrames or “auto” for decisions involving a single DataFrame. “decision” is the decision on which engine to use for that switch point.

Parameters:

simple – bool, default True If False, this will display the raw hybrid switch point information including costing calculations and dataset size estimates.

Returns:

A native pandas DataFrame containing the log of backend switches.

Return type:

pandas.DataFrame

Examples

>>> from modin.config import context as config_context
>>> with config_context(AutoSwitchBackend=True):
...     df = pd.DataFrame({'Animal': ['Falcon', 'Falcon',
...         'Parrot', 'Parrot'],
...         'Max Speed': [380., 370., 24., 26.]})
>>> pd.explain_switch()  
                                  decision
source    api                mode
<unknown> DataFrame.__init__ auto
                             auto   Pandas
Copy