File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
enterprise_gateway/itests Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 21
21
with :
22
22
clean : true
23
23
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
24
- with :
25
- python_version : " ${{ matrix.python-version }}"
24
+ # with:
25
+ # python_version: "${{ matrix.python-version }}"
26
26
- name : Display dependency info
27
27
run : |
28
28
python --version
33
33
- name : Install Python dependencies
34
34
run : |
35
35
pip install ".[test]"
36
+ pip install --upgrade cloudpickle
36
37
- name : Build and install Jupyter Enterprise Gateway
37
38
uses :
nick-invision/[email protected]
38
39
with :
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ def test_run_pi_example(self):
122
122
pi_code = []
123
123
pi_code .append ("from random import random\n " )
124
124
pi_code .append ("from operator import add\n " )
125
+ pi_code .append ("import cloudpickle\n " )
125
126
pi_code .append ("partitions = 20\n " )
126
127
pi_code .append ("n = 100000 * partitions\n " )
127
128
# Define the function with explicit imports inside to avoid serialization issues
@@ -130,6 +131,8 @@ def test_run_pi_example(self):
130
131
pi_code .append (" x = random() * 2 - 1\n " )
131
132
pi_code .append (" y = random() * 2 - 1\n " )
132
133
pi_code .append (" return 1 if x ** 2 + y ** 2 <= 1 else 0\n " )
134
+ pi_code .append ("pickled_f = cloudpickle.dumps(f)\n " )
135
+ pi_code .append ("print('Function f successfully pickled!')\n " )
133
136
# Use a lambda function directly in map to avoid complex serialization
134
137
pi_code .append ("count = sc.parallelize(range(1, n + 1), partitions).map(f).reduce(add)\n " )
135
138
pi_code .append ('print("Pi is roughly %f" % (4.0 * count / n))\n ' )
You can’t perform that action at this time.
0 commit comments