pgstac icon indicating copy to clipboard operation
pgstac copied to clipboard

Typing improvements and loosened dependencies

Open Zaczero opened this issue 1 year ago • 3 comments

This PR is a set of several typing improvements as well as loosened dependencies which resolves #341. While this PR bundles several changes, the commits are atomic and should be simple to review individually.

More notable changes:

  • pydantic depdendency was replaced with pydantic-settings as in official docs.
  • set_json_dumps no longer uses a .decode() wrapper method, since bytes return is supported in psycopg since 3.1.9.
  • pathlib.Path type hints were removed since from my testing they never worked (they are not an instance of str).

Zaczero avatar Jan 27 '25 20:01 Zaczero

Hey @Zaczero Thanks for kicking this PR up here.

I am not too keen on just using >= for dependencies as (particularly with a major release version) there is a good chance that there could be breaking changes from dependencies.

For pydantic, I do know that we need to integrate with some libraries that still are using pydantic v1. This is why we use the v1 compatibility layer in Pydantic v2 that allows us to still use the old pydantic base settings api.

bitner avatar Feb 10 '25 18:02 bitner

can we close this? most of the requested changes were done in https://github.com/stac-utils/pgstac/pull/352

The pydantic change is a breaking change which would need to be proposed in a specific PR

vincentsarago avatar Feb 24 '25 21:02 vincentsarago

"most of the requested changes were done"

I don't think calling it "most" is correct here. This PR also aimed to resolve typing issues with the project (see the changed files). However, I also don't currently intend to do further work on this project; if someone cares about having correct types, I would suggest extracting individual changes or having maintainers edit this PR. Project maintainers are allowed to edit it:

image

Zaczero avatar Feb 25 '25 12:02 Zaczero