Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pydantic warning on data_test run #1445

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

inwaves
Copy link
Contributor

@inwaves inwaves commented Dec 21, 2023

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

Copy link
Collaborator

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for cleaning up the logs!

@etr2460 etr2460 merged commit dd38662 into openai:main Dec 21, 2023
1 check passed
@inwaves inwaves deleted the fix/PydanticWarningOnTestRun branch December 22, 2023 09:25
jacobbieker pushed a commit to withmartian/-ARCHIVED--router-evals that referenced this pull request Jan 9, 2024
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
```
Linmj-Judy pushed a commit to TablewareBox/evals that referenced this pull request Feb 27, 2024
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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants