Phil Dreizen
05/23/2023, 4:17 PMDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 763, in _finalize_fairy
fairy._reset(pool, transaction_was_reset)
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1038, in _reset
pool._dialect.do_rollback(self)
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 683, in do_rollback
dbapi_connection.rollback()
sqlite3.ProgrammingError: Cannot operate on a closed database.
Full error in threadFAILED civitech_dagster_tests/test_usvf.py::test_elections - Exception: FORCED
==================================================================== 1 failed, 1 passed, 4 warnings in 3.66s ====================================================================
Exception during reset or similar
Traceback (most recent call last):
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/dagster/_core/execution/api.py", line 280, in ephemeral_instance_if_missing
yield ephemeral_instance
GeneratorExit
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 763, in _finalize_fairy
fairy._reset(pool, transaction_was_reset)
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1038, in _reset
pool._dialect.do_rollback(self)
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 683, in do_rollback
dbapi_connection.rollback()
sqlite3.ProgrammingError: Cannot operate on a closed database.
Exception during reset or similar
Traceback (most recent call last):
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/dagster/_core/execution/api.py", line 280, in ephemeral_instance_if_missing
yield ephemeral_instance
GeneratorExit
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 763, in _finalize_fairy
fairy._reset(pool, transaction_was_reset)
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1038, in _reset
pool._dialect.do_rollback(self)
File "/Users/phil/code/dagster/.venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 683, in do_rollback
dbapi_connection.rollback()
sqlite3.ProgrammingError: Cannot operate on a closed database.
def test_asset():
mock_api = mock.Mock()
mock_api.get.return_value = [...]
expected = [...]
context = dagster.build_op_context()
actual = asset(context, the_api=mock_api)
assert actual == expected
daniel
05/23/2023, 4:25 PMwith dagster.build_op_context() as context:
actual = asset(context, the_api=mock_api)
Phil Dreizen
05/23/2023, 4:27 PMdaniel
05/23/2023, 4:31 PMwith DagsterInstance.ephemeral() as instance:
context = dagster.build_op_context(instance=instance)
actual = asset(context, the_api=mock_api)
If that fixes it, there may be an underlying resource cleanup issue with our asset invocation API that we can investigatePhil Dreizen
05/23/2023, 4:37 PMdaniel
05/23/2023, 4:37 PMfrom dagster import asset, build_op_context
@asset
def my_asset(context):
pass
def test_asset() -> None:
print("HELLO")
expected = [...]
context = build_op_context()
actual = my_asset(context)
assert False
Phil Dreizen
05/23/2023, 4:42 PMdaniel
05/23/2023, 4:42 PMPhil Dreizen
05/23/2023, 4:57 PMdaniel
05/23/2023, 5:03 PMPhil Dreizen
05/23/2023, 5:34 PM