Skip to content

feat: add cli event handler #625

feat: add cli event handler

feat: add cli event handler #625

GitHub Actions / JUnit Test Report failed Dec 19, 2024 in 0s

237 tests run, 227 passed, 9 skipped, 1 failed.

Annotations

Check failure on line 173 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_vector_store_list_json

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Raw output
def test_vector_store_list_json():
        autoregister()
        runner = CliRunner(mix_stderr=False)
        result = runner.invoke(
            root_app,
            [
                "--output",
                "json",
                "vector-store",
                "--factory-path",
                "cli.test_vector_store:vector_store_factory",
                "list",
            ],
        )
        print(result.stderr)
        assert result.exit_code == 0
>       dicts = json.loads(result.stdout)

packages/ragbits-core/tests/cli/test_vector_store.py:173: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../.local/share/uv/python/cpython-3.10.15-linux-x86_64-gnu/lib/python3.10/json/__init__.py:346: in loads
    return _default_decoder.decode(s)
../../../.local/share/uv/python/cpython-3.10.15-linux-x86_64-gnu/lib/python3.10/json/decoder.py:337: in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <json.decoder.JSONDecoder object at 0x7feb3b0d8b20>
s = "Verbose mode is disabled.\nNo verbose state\nNo verbose state\n┏━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━... │ [7.0, 8.0] │ {'foo': 'bar', 'baz': 'qux'}     │\n└────┴─────────┴────────────┴──────────────────────────────────┘\n"
idx = 0

    def raw_decode(self, s, idx=0):
        """Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.
    
        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.
    
        """
        try:
            obj, end = self.scan_once(s, idx)
        except StopIteration as err:
>           raise JSONDecodeError("Expecting value", s, err.value) from None
E           json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

../../../.local/share/uv/python/cpython-3.10.15-linux-x86_64-gnu/lib/python3.10/json/decoder.py:355: JSONDecodeError