Closed zstatmanweil closed 1 month ago
thanks for the report, I'll have a look 🙏
I think I see the issue, and I think it may be a pgstac issue. In pgstac v0.9.1, none of the _where
or orderby
fields are populating in the search
table, and the search_wheres
is not being populated at all. I have mostly been using our database with stac-fastapi, where this hasn't been an issue as it would just affect performance. But here in titiler, it is throwing a pydantic error as it expects those columns to be populated.
I will open an issue in pgstac.
we could patch titiler-pgstac and make https://github.com/stac-utils/titiler-pgstac/blob/main/titiler/pgstac/model.py#L200-L201 optional
That would be great if it doesn't affect the actual searches run. I think the search_wheres
logic is mostly for caching, right?
it won't affect anything on titiler-pgstac side. The search
model is just used in the /info
and in the /register
endpoints.
I've tried a simple fix in #170 but that's not enough 😅
Ah yeah, failing a test. Interestingly _where
and orderby
are not constrained to not be null in the actual database.
Your suggestion does make titiler-pgstac
usable for me though! It seems to be working.
so there is another change in pgstac, before 0.9 when a search
didn't exist, pgstac was returning a Search with Query Hash {self.input} Not Found"
message
now we get psycopg.errors.NotNullViolation: null value in column "search" of relation "searches" violates not-null constraint
, seems that https://github.com/stac-utils/pgstac/compare/v0.8.5...v0.9.0#diff-bc6e3521e72191870b534855e7973b456f89a1756315fb23510b50d926238f3aR51-R52 is not reached
cc @bitner
I have worked through the demo and got everything working properly; however, when working through similar examples with my own database, I am seeing this error:
I am not having any trouble with the STAC item endpoints, but when I am using the STAC Collection endpoints or Search endpoints I see it. For example, I see this validation error when running the following:
I am on pgstac 0.9.1 and am thinking that may be the issue so I tried the demo with the pgstac image
v0.9.1
and confirmed I saw the same error and was no longer able to run the demo.Is
titiler-pgstac
not compatible with pgstac 0.9.X yet? Anything easy that can be tweaked to get it working?