-
Notifications
You must be signed in to change notification settings - Fork 10
TypeError: 'sci:citation' is an invalid keyword argument for Collection #26
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
Comments
We're getting the same error when adding our Radiant MLHub collections which all extend the scientific extension |
I've run into a similar problem - this is due to a current limitation of stac-fastapi on handling custom models. The limitation is described here: stac-utils/stac-fastapi#58. The issue you're seeing is the top-level "sci:citiation" property doesn't map to any stac-pydantic field. Even if you were able to use a subclassed stac-pydantic model that did add that field, the SQLAlchemy backend wouldn't support it because there's no column for it in the database model. This is a tricky issue that had me stuck on a fork of arturo-stac-api, in which I added a database change to account for this in this commit. The upcoming pgstac backend will not have the problem on the database side, as it will use JSONB for all the Collection (and also Item) properties and won't need additional columns for custom data fields. However, the stac-pydantic model subclassing issue will still remain. I think a solution to this would be to add a setting to The sore spot with that solution is that, if you encounter another extension, the custom model will have to be updated to account for that. I don't believe there's a catch-all in stac-pydantic to deal with arbitrary extensions (or to just allow properties that it doesn't recognize). This might be a reason to consider relaxing the validation constrictions on the pydantic models, or even to move to PySTAC as the internal STAC model (though we'd lose some of the FastAPI <-> Pydantic nicities, which tbh I've found more confusing/in the way than beneficial, at least besides the auto OpenAPI schema definitions). |
Agreed,
You can set
We've done this for the |
After some discussion with @geospatial-jeff and @lossyrob, I've spiked out a small prototype of what would be needed with the current |
Uh oh!
There was an error while loading. Please reload this page.
Hi again!
When I try to extent the collection fields, for instance, using the scientific extension (example)
sci:citation
I got the next error.collection.json
error
This is really curious because when I try to extent with some other fields like keyword no errors appears.
collection.json
error
NO ERROR
I tried to modify the files '/stac_api/models/schemas.py' and
/stac_fastapi/sqlalchemy/models/database.py
but with no success any help will be appreciated!PS: I tried the same in versions 1.1.0 and 1.0.0 and this problem persist.
The text was updated successfully, but these errors were encountered: