About
Test error using FileStore
Uploaded 6 d ago
by RobinHorton
- Object Notebook
Download
In [1]:
from edsl import ScenarioList, Scenario
from edsl.scenarios.FileStore import CSVFileStore
In [2]:
fs = CSVFileStore.pull("429f0b54-58da-4df0-a1bb-f6c0223ba9db")
In [3]:
s = ScenarioList.from_csv(fs.to_tempfile())
In [4]:
s
Out[4]:
{
"scenarios": [
{
"persona": "A reseacher studying whether LLMs can be used to generate surveys."
},
{
"persona": "A reseacher studying whether LLMs can be used to generate surveys."
}
]
}
Error running test:¶
In [ ]:
(edsl-py3.11) a16174@MacBook-Air edsl % make test-notebooks notebook='filestore_example.ipynb'
Testing notebook: filestore_example.ipynb
======================================================= test session starts =======================================================
platform darwin -- Python 3.11.7, pytest-7.4.4, pluggy-1.5.0 -- /Users/a16174/edsl/.venv/bin/python
cachedir: .pytest_cache
metadata: {'Python': '3.11.7', 'Platform': 'macOS-14.6.1-arm64-arm-64bit', 'Packages': {'pytest': '7.4.4', 'pluggy': '1.5.0'}, 'Plugins': {'asyncio': '0.23.8', 'html': '4.1.1', 'env': '1.1.3', 'metadata': '3.1.1', 'anyio': '4.4.0', 'Faker': '28.4.1', 'profiling': '1.7.0', 'mock': '3.14.0', 'xdist': '3.6.1'}}
rootdir: /Users/a16174/edsl/integration
configfile: pytest.ini
plugins: asyncio-0.23.8, html-4.1.1, env-1.1.3, metadata-3.1.1, anyio-4.4.0, Faker-28.4.1, profiling-1.7.0, mock-3.14.0, xdist-3.6.1
asyncio: mode=Mode.STRICT
collected 121 items / 120 deselected / 1 selected
integration/active/test_notebooks.py::test_notebook_execution[docs/notebooks/filestore_example.ipynb] FAILED [100%]
============================================================ FAILURES =============================================================
_________________________________ test_notebook_execution[docs/notebooks/filestore_example.ipynb] _________________________________
notebook_path = 'docs/notebooks/filestore_example.ipynb'
def execute_notebook(notebook_path):
"""
Execute a Jupyter notebook and either returns True if successful or raises an exception.
Skips cells tagged with 'skip-execution'.
"""
with open(notebook_path) as f:
nb = nbformat.read(f, as_version=4)
ep = SkipTaggedCells(timeout=600, kernel_name="python3")
try:
# Attempt to execute the notebook
> ep.preprocess(nb, {"metadata": {"path": os.path.dirname(notebook_path)}})
integration/active/test_notebooks.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.11/site-packages/nbconvert/preprocessors/execute.py:103: in preprocess
self.preprocess_cell(cell, resources, index)
integration/active/test_notebooks.py:13: in preprocess_cell
return super().preprocess_cell(cell, resources, cell_index)
.venv/lib/python3.11/site-packages/nbconvert/preprocessors/execute.py:124: in preprocess_cell
cell = self.execute_cell(cell, index, store_history=True)
.venv/lib/python3.11/site-packages/jupyter_core/utils/__init__.py:165: in wrapped
return loop.run_until_complete(inner)
../.pyenv/versions/3.11.7/lib/python3.11/asyncio/base_events.py:653: in run_until_complete
return future.result()
.venv/lib/python3.11/site-packages/nbclient/client.py:1062: in async_execute_cell
await self._check_raise_for_error(cell, cell_index, exec_reply)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test_notebooks.SkipTaggedCells object at 0x1042f7e10>
cell = {'cell_type': 'code', 'execution_count': 2, 'id': 'b4b3351b-d6fd-4d88-992b-a6799ac0a493', 'metadata': {'editable': Tru...b[0m: Could not connect to the server.']}], 'source': 'fs = CSVFileStore.pull("429f0b54-58da-4df0-a1bb-f6c0223ba9db")'}
cell_index = 1
exec_reply = {'buffers': [], 'content': {'ename': 'ConnectionError', 'engine_info': {'engine_id': -1, 'engine_uuid': 'eddd5507-de48...e, 'engine': 'eddd5507-de48-44a5-a444-9b30d4e7d8cb', 'started': '2024-09-12T20:42:33.626700Z', 'status': 'error'}, ...}
async def _check_raise_for_error(
self, cell: NotebookNode, cell_index: int, exec_reply: dict[str, t.Any] | None
) -> None:
if exec_reply is None:
return None
exec_reply_content = exec_reply["content"]
if exec_reply_content["status"] != "error":
return None
cell_allows_errors = (not self.force_raise_errors) and (
self.allow_errors
or exec_reply_content.get("ename") in self.allow_error_names
or "raises-exception" in cell.metadata.get("tags", [])
)
await run_hook(
self.on_cell_error, cell=cell, cell_index=cell_index, execute_reply=exec_reply
)
if not cell_allows_errors:
> raise CellExecutionError.from_cell_and_msg(cell, exec_reply_content)
E nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
E ------------------
E fs = CSVFileStore.pull("429f0b54-58da-4df0-a1bb-f6c0223ba9db")
E ------------------
E
E
E ---------------------------------------------------------------------------
E ConnectionRefusedError Traceback (most recent call last)
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connection.py:196, in HTTPConnection._new_conn(self)
E 195 try:
E --> 196 sock = connection.create_connection(
E 197 (self._dns_host, self.port),
E 198 self.timeout,
E 199 source_address=self.source_address,
E 200 socket_options=self.socket_options,
E 201 )
E 202 except socket.gaierror as e:
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/util/connection.py:85, in create_connection(address, timeout, source_address, socket_options)
E 84 try:
E ---> 85 raise err
E 86 finally:
E 87 # Break explicitly a reference cycle
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/util/connection.py:73, in create_connection(address, timeout, source_address, socket_options)
E 72 sock.bind(source_address)
E ---> 73 sock.connect(sa)
E 74 # Break explicitly a reference cycle
E
E ConnectionRefusedError: [Errno 61] Connection refused
E
E The above exception was the direct cause of the following exception:
E
E NewConnectionError Traceback (most recent call last)
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
E 788 # Make the request on the HTTPConnection object
E --> 789 response = self._make_request(
E 790 conn,
E 791 method,
E 792 url,
E 793 timeout=timeout_obj,
E 794 body=body,
E 795 headers=headers,
E 796 chunked=chunked,
E 797 retries=retries,
E 798 response_conn=response_conn,
E 799 preload_content=preload_content,
E 800 decode_content=decode_content,
E 801 **response_kw,
E 802 )
E 804 # Everything went great!
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:495, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
E 494 try:
E --> 495 conn.request(
E 496 method,
E 497 url,
E 498 body=body,
E 499 headers=headers,
E 500 chunked=chunked,
E 501 preload_content=preload_content,
E 502 decode_content=decode_content,
E 503 enforce_content_length=enforce_content_length,
E 504 )
E 506 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is
E 507 # legitimately able to close the connection after sending a valid response.
E 508 # With this behaviour, the received response is still readable.
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connection.py:398, in HTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length)
E 397 self.putheader(header, value)
E --> 398 self.endheaders()
E 400 # If we're given a body we start sending that in chunks.
E
E File ~/.pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289, in HTTPConnection.endheaders(self, message_body, encode_chunked)
E 1288 raise CannotSendHeader()
E -> 1289 self._send_output(message_body, encode_chunked=encode_chunked)
E
E File ~/.pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048, in HTTPConnection._send_output(self, message_body, encode_chunked)
E 1047 del self._buffer[:]
E -> 1048 self.send(msg)
E 1050 if message_body is not None:
E 1051
E 1052 # create a consistent interface to message_body
E
E File ~/.pyenv/versions/3.11.7/lib/python3.11/http/client.py:986, in HTTPConnection.send(self, data)
E 985 if self.auto_open:
E --> 986 self.connect()
E 987 else:
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connection.py:236, in HTTPConnection.connect(self)
E 235 def connect(self) -> None:
E --> 236 self.sock = self._new_conn()
E 237 if self._tunnel_host:
E 238 # If we're tunneling it means we're connected to our proxy.
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connection.py:211, in HTTPConnection._new_conn(self)
E 210 except OSError as e:
E --> 211 raise NewConnectionError(
E 212 self, f"Failed to establish a new connection: {e}"
E 213 ) from e
E 215 # Audit hooks are only available in Python 3.8+
E
E NewConnectionError: <urllib3.connection.HTTPConnection object at 0x120245790>: Failed to establish a new connection: [Errno 61] Connection refused
E
E The above exception was the direct cause of the following exception:
E
E MaxRetryError Traceback (most recent call last)
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/adapters.py:667, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
E 666 try:
E --> 667 resp = conn.urlopen(
E 668 method=request.method,
E 669 url=url,
E 670 body=request.body,
E 671 headers=request.headers,
E 672 redirect=False,
E 673 assert_same_host=False,
E 674 preload_content=False,
E 675 decode_content=False,
E 676 retries=self.max_retries,
E 677 timeout=timeout,
E 678 chunked=chunked,
E 679 )
E 681 except (ProtocolError, OSError) as err:
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:843, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
E 841 new_e = ProtocolError("Connection aborted.", new_e)
E --> 843 retries = retries.increment(
E 844 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
E 845 )
E 846 retries.sleep()
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/util/retry.py:519, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
E 518 reason = error or ResponseError(cause)
E --> 519 raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
E 521 log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)
E
E MaxRetryError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v0/object?uuid=429f0b54-58da-4df0-a1bb-f6c0223ba9db (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x120245790>: Failed to establish a new connection: [Errno 61] Connection refused'))
E
E During handling of the above exception, another exception occurred:
E
E ConnectionError Traceback (most recent call last)
E File ~/edsl/edsl/coop/coop.py:69, in Coop._send_server_request(self, uri, method, payload, params, timeout)
E 68 if method in ["GET", "DELETE"]:
E ---> 69 response = requests.request(
E 70 method, url, params=params, headers=self.headers, timeout=timeout
E 71 )
E 72 elif method in ["POST", "PATCH"]:
E
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/api.py:59, in request(method, url, **kwargs)
E 58 with sessions.Session() as session:
E ---> 59 return session.request(method=method, url=url, **kwargs)
E
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/sessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
E 588 send_kwargs.update(settings)
E --> 589 resp = self.send(prep, **send_kwargs)
E 591 return resp
E
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/sessions.py:703, in Session.send(self, request, **kwargs)
E 702 # Send the request
E --> 703 r = adapter.send(request, **kwargs)
E 705 # Total elapsed time of the request (approximately)
E
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/adapters.py:700, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
E 698 raise SSLError(e, request=request)
E --> 700 raise ConnectionError(e, request=request)
E 702 except ClosedPoolError as e:
E
E ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v0/object?uuid=429f0b54-58da-4df0-a1bb-f6c0223ba9db (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x120245790>: Failed to establish a new connection: [Errno 61] Connection refused'))
E
E During handling of the above exception, another exception occurred:
E
E ConnectionError Traceback (most recent call last)
E Cell In[2], line 1
E ----> 1 fs = CSVFileStore.pull("429f0b54-58da-4df0-a1bb-f6c0223ba9db")
E
E File ~/edsl/edsl/scenarios/FileStore.py:124, in FileStore.pull(cls, uuid)
E 122 @classmethod
E 123 def pull(cls, uuid):
E --> 124 scenario_version = Scenario.pull(uuid)
E 125 return cls.from_dict(scenario_version.to_dict())
E
E File ~/edsl/edsl/Base.py:65, in PersistenceMixin.pull(cls, uuid, url)
E 63 object_type = ObjectRegistry.get_object_type_by_edsl_class(cls)
E 64 coop = Coop()
E ---> 65 return coop.get(uuid, url, object_type)
E
E File ~/edsl/edsl/coop/coop.py:193, in Coop.get(self, uuid, url, expected_object_type)
E 181 """
E 182 Retrieve an EDSL object by its uuid or its url.
E 183 - If the object's visibility is private, the user must be the owner.
E (...)
E 190 :return: the object instance.
E 191 """
E 192 uuid = self._resolve_uuid(uuid, url)
E --> 193 response = self._send_server_request(
E 194 uri=f"api/v0/object",
E 195 method="GET",
E 196 params={"uuid": uuid},
E 197 )
E 198 self._resolve_server_response(response)
E 199 json_string = response.json().get("json_string")
E
E File ~/edsl/edsl/coop/coop.py:84, in Coop._send_server_request(self, uri, method, payload, params, timeout)
E 82 raise Exception(f"Invalid {method=}.")
E 83 except requests.ConnectionError:
E ---> 84 raise requests.ConnectionError("Could not connect to the server.")
E 86 return response
E
E ConnectionError: Could not connect to the server.
.venv/lib/python3.11/site-packages/nbclient/client.py:918: CellExecutionError
During handling of the above exception, another exception occurred:
notebook_path = 'docs/notebooks/filestore_example.ipynb'
@pytest.mark.parametrize("notebook_path", get_notebooks())
def test_notebook_execution(notebook_path):
"""
Test function that executes each Jupyter notebook and checks for exceptions.
"""
print(f"Executing {notebook_path}...")
> execute_notebook(notebook_path)
integration/active/test_notebooks.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
notebook_path = 'docs/notebooks/filestore_example.ipynb'
def execute_notebook(notebook_path):
"""
Execute a Jupyter notebook and either returns True if successful or raises an exception.
Skips cells tagged with 'skip-execution'.
"""
with open(notebook_path) as f:
nb = nbformat.read(f, as_version=4)
ep = SkipTaggedCells(timeout=600, kernel_name="python3")
try:
# Attempt to execute the notebook
ep.preprocess(nb, {"metadata": {"path": os.path.dirname(notebook_path)}})
except CellExecutionError as cell_error:
> raise AssertionError(f"Execution error in {notebook_path}: {cell_error}")
E AssertionError: Execution error in docs/notebooks/filestore_example.ipynb: An error occurred while executing the following cell:
E ------------------
E fs = CSVFileStore.pull("429f0b54-58da-4df0-a1bb-f6c0223ba9db")
E ------------------
E
E
E ---------------------------------------------------------------------------
E ConnectionRefusedError Traceback (most recent call last)
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connection.py:196, in HTTPConnection._new_conn(self)
E 195 try:
E --> 196 sock = connection.create_connection(
E 197 (self._dns_host, self.port),
E 198 self.timeout,
E 199 source_address=self.source_address,
E 200 socket_options=self.socket_options,
E 201 )
E 202 except socket.gaierror as e:
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/util/connection.py:85, in create_connection(address, timeout, source_address, socket_options)
E 84 try:
E ---> 85 raise err
E 86 finally:
E 87 # Break explicitly a reference cycle
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/util/connection.py:73, in create_connection(address, timeout, source_address, socket_options)
E 72 sock.bind(source_address)
E ---> 73 sock.connect(sa)
E 74 # Break explicitly a reference cycle
E
E ConnectionRefusedError: [Errno 61] Connection refused
E
E The above exception was the direct cause of the following exception:
E
E NewConnectionError Traceback (most recent call last)
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
E 788 # Make the request on the HTTPConnection object
E --> 789 response = self._make_request(
E 790 conn,
E 791 method,
E 792 url,
E 793 timeout=timeout_obj,
E 794 body=body,
E 795 headers=headers,
E 796 chunked=chunked,
E 797 retries=retries,
E 798 response_conn=response_conn,
E 799 preload_content=preload_content,
E 800 decode_content=decode_content,
E 801 **response_kw,
E 802 )
E 804 # Everything went great!
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:495, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
E 494 try:
E --> 495 conn.request(
E 496 method,
E 497 url,
E 498 body=body,
E 499 headers=headers,
E 500 chunked=chunked,
E 501 preload_content=preload_content,
E 502 decode_content=decode_content,
E 503 enforce_content_length=enforce_content_length,
E 504 )
E 506 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is
E 507 # legitimately able to close the connection after sending a valid response.
E 508 # With this behaviour, the received response is still readable.
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connection.py:398, in HTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length)
E 397 self.putheader(header, value)
E --> 398 self.endheaders()
E 400 # If we're given a body we start sending that in chunks.
E
E File ~/.pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289, in HTTPConnection.endheaders(self, message_body, encode_chunked)
E 1288 raise CannotSendHeader()
E -> 1289 self._send_output(message_body, encode_chunked=encode_chunked)
E
E File ~/.pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048, in HTTPConnection._send_output(self, message_body, encode_chunked)
E 1047 del self._buffer[:]
E -> 1048 self.send(msg)
E 1050 if message_body is not None:
E 1051
E 1052 # create a consistent interface to message_body
E
E File ~/.pyenv/versions/3.11.7/lib/python3.11/http/client.py:986, in HTTPConnection.send(self, data)
E 985 if self.auto_open:
E --> 986 self.connect()
E 987 else:
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connection.py:236, in HTTPConnection.connect(self)
E 235 def connect(self) -> None:
E --> 236 self.sock = self._new_conn()
E 237 if self._tunnel_host:
E 238 # If we're tunneling it means we're connected to our proxy.
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connection.py:211, in HTTPConnection._new_conn(self)
E 210 except OSError as e:
E --> 211 raise NewConnectionError(
E 212 self, f"Failed to establish a new connection: {e}"
E 213 ) from e
E 215 # Audit hooks are only available in Python 3.8+
E
E NewConnectionError: <urllib3.connection.HTTPConnection object at 0x120245790>: Failed to establish a new connection: [Errno 61] Connection refused
E
E The above exception was the direct cause of the following exception:
E
E MaxRetryError Traceback (most recent call last)
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/adapters.py:667, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
E 666 try:
E --> 667 resp = conn.urlopen(
E 668 method=request.method,
E 669 url=url,
E 670 body=request.body,
E 671 headers=request.headers,
E 672 redirect=False,
E 673 assert_same_host=False,
E 674 preload_content=False,
E 675 decode_content=False,
E 676 retries=self.max_retries,
E 677 timeout=timeout,
E 678 chunked=chunked,
E 679 )
E 681 except (ProtocolError, OSError) as err:
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:843, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
E 841 new_e = ProtocolError("Connection aborted.", new_e)
E --> 843 retries = retries.increment(
E 844 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
E 845 )
E 846 retries.sleep()
E
E File ~/edsl/.venv/lib/python3.11/site-packages/urllib3/util/retry.py:519, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
E 518 reason = error or ResponseError(cause)
E --> 519 raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
E 521 log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)
E
E MaxRetryError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v0/object?uuid=429f0b54-58da-4df0-a1bb-f6c0223ba9db (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x120245790>: Failed to establish a new connection: [Errno 61] Connection refused'))
E
E During handling of the above exception, another exception occurred:
E
E ConnectionError Traceback (most recent call last)
E File ~/edsl/edsl/coop/coop.py:69, in Coop._send_server_request(self, uri, method, payload, params, timeout)
E 68 if method in ["GET", "DELETE"]:
E ---> 69 response = requests.request(
E 70 method, url, params=params, headers=self.headers, timeout=timeout
E 71 )
E 72 elif method in ["POST", "PATCH"]:
E
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/api.py:59, in request(method, url, **kwargs)
E 58 with sessions.Session() as session:
E ---> 59 return session.request(method=method, url=url, **kwargs)
E
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/sessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
E 588 send_kwargs.update(settings)
E --> 589 resp = self.send(prep, **send_kwargs)
E 591 return resp
E
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/sessions.py:703, in Session.send(self, request, **kwargs)
E 702 # Send the request
E --> 703 r = adapter.send(request, **kwargs)
E 705 # Total elapsed time of the request (approximately)
E
E File ~/edsl/.venv/lib/python3.11/site-packages/requests/adapters.py:700, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
E 698 raise SSLError(e, request=request)
E --> 700 raise ConnectionError(e, request=request)
E 702 except ClosedPoolError as e:
E
E ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v0/object?uuid=429f0b54-58da-4df0-a1bb-f6c0223ba9db (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x120245790>: Failed to establish a new connection: [Errno 61] Connection refused'))
E
E During handling of the above exception, another exception occurred:
E
E ConnectionError Traceback (most recent call last)
E Cell In[2], line 1
E ----> 1 fs = CSVFileStore.pull("429f0b54-58da-4df0-a1bb-f6c0223ba9db")
E
E File ~/edsl/edsl/scenarios/FileStore.py:124, in FileStore.pull(cls, uuid)
E 122 @classmethod
E 123 def pull(cls, uuid):
E --> 124 scenario_version = Scenario.pull(uuid)
E 125 return cls.from_dict(scenario_version.to_dict())
E
E File ~/edsl/edsl/Base.py:65, in PersistenceMixin.pull(cls, uuid, url)
E 63 object_type = ObjectRegistry.get_object_type_by_edsl_class(cls)
E 64 coop = Coop()
E ---> 65 return coop.get(uuid, url, object_type)
E
E File ~/edsl/edsl/coop/coop.py:193, in Coop.get(self, uuid, url, expected_object_type)
E 181 """
E 182 Retrieve an EDSL object by its uuid or its url.
E 183 - If the object's visibility is private, the user must be the owner.
E (...)
E 190 :return: the object instance.
E 191 """
E 192 uuid = self._resolve_uuid(uuid, url)
E --> 193 response = self._send_server_request(
E 194 uri=f"api/v0/object",
E 195 method="GET",
E 196 params={"uuid": uuid},
E 197 )
E 198 self._resolve_server_response(response)
E 199 json_string = response.json().get("json_string")
E
E File ~/edsl/edsl/coop/coop.py:84, in Coop._send_server_request(self, uri, method, payload, params, timeout)
E 82 raise Exception(f"Invalid {method=}.")
E 83 except requests.ConnectionError:
E ---> 84 raise requests.ConnectionError("Could not connect to the server.")
E 86 return response
E
E ConnectionError: Could not connect to the server.
integration/active/test_notebooks.py:29: AssertionError
------------------------------------------------------ Captured stdout call -------------------------------------------------------
Executing docs/notebooks/filestore_example.ipynb...
===================================================== short test summary info =====================================================
FAILED integration/active/test_notebooks.py::test_notebook_execution[docs/notebooks/filestore_example.ipynb] - AssertionError: Execution error in docs/notebooks/filestore_example.ipynb: An error occurred while executing the following cell:
================================================ 1 failed, 120 deselected in 2.27s ================================================
make: *** [test-notebooks] Error 1
In [5]:
from edsl import Notebook
In [ ]:
n = Notebook(path = "filestore_example.ipynb")
In [ ]:
n.push(description = "Test error using FileStore")
from edsl import Notebook
notebook = Notebook.pull("b145af25-e864-40fe-b7af-a61942a16ca9")
# this object is too large to display here