|
1 | 1 | =========================================== |
2 | | -Hybrid Execution (Public Preview) |
| 2 | +Hybrid Execution |
3 | 3 | =========================================== |
4 | 4 |
|
5 | 5 | Snowpark pandas supports workloads on mixed underlying execution engines and will automatically |
@@ -37,24 +37,37 @@ read_snowflake, value_counts, tail, var, std, sum, sem, max, min, mean, agg, agg |
37 | 37 | Examples |
38 | 38 | ======== |
39 | 39 |
|
40 | | -Enabling Hybrid Execution |
| 40 | +Enabling and Disabling Hybrid Execution |
41 | 41 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
42 | 42 |
|
43 | | -.. code-block:: python |
| 43 | +Hybrid execution is enabled by default, and can be turned off with the AutoSwitchBackend variable. |
44 | 44 |
|
| 45 | +.. code-block:: python |
45 | 46 | import modin.pandas as pd |
46 | 47 | import snowflake.snowpark.modin.plugin |
47 | 48 |
|
48 | 49 | # Import the configuration variable |
49 | 50 | from modin.config import AutoSwitchBackend |
| 51 | +
|
| 52 | + # Disable Hybrid mode |
| 53 | + AutoSwitchBackend.disable() |
| 54 | +
|
| 55 | + # Enable Hybrid mode |
| 56 | + AutoSwitchBackend.enable() |
| 57 | +
|
| 58 | +You can selectively disable hybrid mode within a context imported |
| 59 | +from modin.config |
| 60 | + |
| 61 | +.. code-block:: python |
| 62 | +
|
| 63 | + import modin.pandas as pd |
| 64 | + import snowflake.snowpark.modin.plugin |
50 | 65 | from snowflake.snowpark import Session |
51 | 66 | |
52 | 67 | Session.builder.create() |
53 | 68 | df = pd.DataFrame([1, 2, 3]) |
54 | 69 | print(df.get_backend()) # 'Snowflake' |
55 | 70 |
|
56 | | - # Enable hybrid execution |
57 | | - AutoSwitchBackend().enable() |
58 | 71 | df = pd.DataFrame([4, 5, 6]) |
59 | 72 | # DataFrame should use local execution backend, 'Pandas' |
60 | 73 | # because the data frame is already small and in memory |
|
0 commit comments