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

Address warnings produced by pydantic 2.x in tests #702

Closed
danielballan opened this issue Mar 28, 2024 · 0 comments · Fixed by #706
Closed

Address warnings produced by pydantic 2.x in tests #702

danielballan opened this issue Mar 28, 2024 · 0 comments · Fixed by #706

Comments

@danielballan
Copy link
Member

#695 got the tests passing with pydantc 2.x, but running pytest generates many warnings showing that the current usage includes some deprecated patterns.

$ pytest v
<snipped>
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/main.py:1306
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/main.py:1306
  /home/dallan/mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/main.py:1306: PydanticDeprecatedSince20: The `update_forward_refs` method is deprecated; use `model_rebuild` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.6/migration/
    warnings.warn(

../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/_internal/_config.py:272
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/_internal/_config.py:272
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/_internal/_config.py:272
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/_internal/_config.py:272
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/_internal/_config.py:272
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/_internal/_config.py:272
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/_internal/_config.py:272
  /home/dallan/mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/_internal/_config.py:272: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.6/migration/
    warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning)

../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/fields.py:754
../../../mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/fields.py:754
  /home/dallan/mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/fields.py:754: PydanticDeprecatedSince20: Using extra keyword arguments on `Field` is deprecated and will be removed. Use `json_schema_extra` instead. (Extra keys: 'example'). Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.6/migration/
    warn(

tiled/_tests/test_access_control.py: 76 warnings
tiled/_tests/test_allow_origins.py: 2 warnings
tiled/_tests/test_array.py: 84 warnings
tiled/_tests/test_asset_access.py: 40 warnings
tiled/_tests/test_authentication.py: 111 warnings
tiled/_tests/test_awkward.py: 36 warnings
tiled/_tests/test_catalog.py: 56 warnings
tiled/_tests/test_client.py: 50 warnings
tiled/_tests/test_client_cache.py: 64 warnings
tiled/_tests/test_compression.py: 2 warnings
tiled/_tests/test_config.py: 76 warnings
tiled/_tests/test_container_fields.py: 51 warnings
tiled/_tests/test_container_files.py: 52 warnings
tiled/_tests/test_custom_format.py: 7 warnings
tiled/_tests/test_dataframe.py: 37 warnings
tiled/_tests/test_decoders.py: 6 warnings
tiled/_tests/test_directory_walker.py: 110 warnings
tiled/_tests/test_distinct.py: 7 warnings
tiled/_tests/test_export.py: 20 warnings
tiled/_tests/test_hdf5.py: 21 warnings
tiled/_tests/test_history.py: 3 warnings
tiled/_tests/test_import_object.py: 2 warnings
tiled/_tests/test_indexers.py: 38 warnings
tiled/_tests/test_inlined_contents.py: 22 warnings
tiled/_tests/test_metrics.py: 6 warnings
tiled/_tests/test_object_cache.py: 23 warnings
tiled/_tests/test_openapi.py: 1 warning
tiled/_tests/test_queries.py: 221 warnings
tiled/_tests/test_search.py: 102 warnings
tiled/_tests/test_size_limit.py: 10 warnings
tiled/_tests/test_sort.py: 18 warnings
tiled/_tests/test_sparse.py: 4 warnings
tiled/_tests/test_specs.py: 6 warnings
tiled/_tests/test_structured_array.py: 3 warnings
tiled/_tests/test_tiff.py: 54 warnings
tiled/_tests/test_validation.py: 22 warnings
tiled/_tests/test_writing.py: 168 warnings
tiled/_tests/test_xarray.py: 27 warnings
  /home/dallan/mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/main.py:1024: PydanticDeprecatedSince20: The `dict` method is deprecated; use `model_dump` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.6/migration/
    warnings.warn('The `dict` method is deprecated; use `model_dump` instead.', category=PydanticDeprecatedSince20)

tiled/_tests/test_access_control.py: 2 warnings
tiled/_tests/test_authentication.py: 46 warnings
  /home/dallan/mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/main.py:1165: PydanticDeprecatedSince20: The `from_orm` method is deprecated; set `model_config['from_attributes']=True` and use `model_validate` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.6/migration/
    warnings.warn(

tiled/_tests/test_catalog.py: 21 warnings
tiled/_tests/test_custom_format.py: 3 warnings
tiled/_tests/test_distinct.py: 4 warnings
tiled/_tests/test_queries.py: 62 warnings
tiled/_tests/test_validation.py: 14 warnings
tiled/_tests/test_writing.py: 171 warnings
  /home/dallan/mambaforge/envs/py311/lib/python3.11/site-packages/pydantic/main.py:1069: PydanticDeprecatedSince20: The `parse_obj` method is deprecated; use `model_validate` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.6/migration/
    warnings.warn(
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 a pull request may close this issue.

1 participant