-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use cql2-json for pgstac #513
Conversation
8e01f5b
to
cfe03bb
Compare
@gadomski thanks for taking a look! I am having trouble setting up a local installation of this branch (see details below), but I think your diagnosis of the problem is correct. In stac-fastapi-pgstac all GET requests with installation errorSadly I don't know where to start on this error 😆 henry@quercus:~/workspace/stac-utils/stac-rs/python$ uv sync
Resolved 142 packages in 3ms
error: Failed to prepare distributions
Caused by: Failed to build `stacrs @ file:///home/henry/workspace/stac-utils/stac-rs/python`
Caused by: Build backend failed to build editable through `build_editable` (exit status: 1)
[stdout]
Running `maturin pep517 build-wheel -i /home/henry/.cache/uv/builds-v0/.tmp4OsYVt/bin/python --compatibility off --editable`
[stderr]
🔗 Found pyo3 bindings
🐍 Found CPython 3.12 at /home/henry/.cache/uv/builds-v0/.tmp4OsYVt/bin/python
📡 Using build options features from pyproject.toml
Compiling pyo3-build-config v0.22.6
Compiling geoarrow v0.3.0
Compiling pyo3-macros-backend v0.22.6
Compiling pyo3-ffi v0.22.6
Compiling pyo3 v0.22.6
Compiling pyo3-macros v0.22.6
Compiling pythonize v0.22.0
error[E0275]: overflow evaluating the requirement `<impl GeometryTrait<T = f64> as geo_traits::geometry::GeometryTrait>::GeometryCollection<'_>: geo_traits::geometry_collection::GeometryCollectionTrait`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`geoarrow`)
note: required for `GeometryCollectionIterator<'_, f64, <... as GeometryCollectionTrait>::ItemType<'_>, ...>` to implement `Iterator`
--> /home/henry/.cargo/registry/src/index.crates.io-6f17d22bba15001f/geoarrow-0.3.0/src/geo_traits/iterator.rs:39:15
|
37 | ItemType: 'a + $item_trait<T = T>,
| ----- unsatisfied trait bound introduced here
38 | G: $self_trait<T = T, ItemType<'a> = ItemType>,
39 | > Iterator for $struct_name<'a, T, ItemType, G>
| ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
109 | / impl_iterator!(
110 | | GeometryCollectionIterator,
111 | | GeometryCollectionTrait,
112 | | GeometryTrait,
113 | | geometry_unchecked
114 | | );
| |_- in this macro invocation
= note: required for `GeometryCollectionIterator<'_, f64, <... as GeometryCollectionTrait>::ItemType<'_>, ...>` to implement `IntoIterator`
= note: the full name for the type has been written to '/home/henry/workspace/stac-utils/stac-rs/target/release/deps/geoarrow-cd11adfc937de9f7.long-type-10257270469153106537.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: the full name for the type has been written to '/home/henry/workspace/stac-utils/stac-rs/target/release/deps/geoarrow-cd11adfc937de9f7.long-type-10257270469153106537.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: this error originates in the macro `impl_iterator` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0275`.
error: could not compile `geoarrow` (lib) due to 1 previous error
💥 maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.12-64bit" PYO3_PYTHON="/home/henry/.cache/uv/builds-v0/.tmp4OsYVt/bin/python" PYTHON_SYS_EXECUTABLE="/home/henry/.cache/uv/builds-v0/.tmp4OsYVt/bin/python" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/home/henry/workspace/stac-utils/stac-rs/python/Cargo.toml" "--release" "--lib"`
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/home/henry/.cache/uv/builds-v0/.tmp4OsYVt/bin/python', '--compatibility', 'off', '--editable'] returned non-zero exit status 1
|
Try keeping your Rust at 1.81 or below, it's a bug in geoarrow-rs: rustup override set 1.81 # to override for your project directory |
That solved the installation problem! As far as I can tell the communication with I am serving the STAC API with: $ cargo run -- serve --pgstac postgresql://username:password@localhost:5439/postgis -v Is there a way to get more verbose logs to help trace the error? |
Yeah, you can provide more RUST_LOG=stac_server=debug cargo run -- serve Apologies for none of this being documented. Happy to debug on my side as well if you want to provide your example query. |
I am seeing more logs with Here is how I am setting up a query in Python (based on the new sentinel-2-l2a items): import httpx
get_params = {
"collection": "sentinel-2-l2a",
"filter": "proj:epsg = 32613",
"limit": 10,
}
get_stacrs = httpx.get(
"http://localhost:7822/search",
params=get_params,
) Here is a plain ol` request URL: |
🙇🏼 thanks so much for kicking the tires here @hrodmn. Turns out I wasn't serializing filters correctly at all, and this helped catch that. Give it another spin — I added a bit more logging and tracing too. |
I pulled the latest changes and everything is working now! A few questions about the PR:
|
Yup, good call ... I'll do that (and update the README) in another PR.
Lol you bet ... there's some, but I hadn't been exercising |
@hrodmn can you try out this branch on your side? pgstac doesn't accept
cql2-text
AFAICT so I added an auto-conversion tocql2-json
.Closes
Includes a sidecar
stacrs pgstac load
command.