openai / evals

Evals is a framework for evaluating LLMs and LLM systems, and an open-source registry of benchmarks.
Other
14.76k stars 2.58k forks source link

Fix Pydantic warning on data_test run #1445

Closed inwaves closed 9 months ago

inwaves commented 9 months ago

This PR fixes a warning from Pydantic when running the JSON dumps test in data_test.py:

evals/data_test.py::test_jsondumps
evals/data_test.py::test_jsondumps
evals/data_test.py::test_jsondumps
  /evals/evals/data.py:191: PydanticDeprecatedSince20: The `json` method is deprecated; use `model_dump_json` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/
    for k, v in json.loads(o.json()).items()

evals/data_test.py::test_jsondumps
evals/data_test.py::test_jsondumps
evals/data_test.py::test_jsondumps
  /evals/lib/python3.9/site-packages/pydantic/main.py:1005: PydanticDeprecatedSince20: The `json` method is deprecated; use `model_dump_json` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/
    warnings.warn('The `json` method is deprecated; use `model_dump_json` instead.', DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html