-
Notifications
You must be signed in to change notification settings - Fork 5
PB-2354: Add CF extension fields #656
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
Merged
asteiner-swisstopo
merged 12 commits into
develop
from
feat-PB-2354-implement-cf-extension
Aug 20, 2026
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
346e8ad
PB-2354: Add CF extension fields to Item properties
asteiner-swisstopo bf75702
PB-2354: Add CF extension fields to admin UI
asteiner-swisstopo 5a1dc16
PB-2354: (De)serialize CF extension fields
asteiner-swisstopo ffc2943
PB-2354: Allow /search to filter by CF extension fields
asteiner-swisstopo 6f98756
PB-2354: Add CF extension fields to API specs
asteiner-swisstopo e079c17
PB-2354: Add CF extension fields to e2e test input
asteiner-swisstopo 5bd174f
PB-2354: Fix link to point to existing release
asteiner-swisstopo 43a349b
PB-2354: Refactor to reduce conditional branches
asteiner-swisstopo bb81b4a
PB-2354: Update pgtrigger for ETag update
asteiner-swisstopo f7a2ac5
PB-2354: Add validation for CF extension property fields
asteiner-swisstopo de2ba15
PB-2354: Filter CF extension fields through "query" param
asteiner-swisstopo 9b0768f
PB-2354: Add comment to make it clear that field belongs to CF extension
asteiner-swisstopo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/stac_api/migrations/0080_item_cf_standard_name_item_unit.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Generated by Django 5.2.13 on 2026-08-10 16:43 | ||
|
|
||
| import pgtrigger.compiler | ||
| import pgtrigger.migrations | ||
|
|
||
| from django.db import migrations | ||
| from django.db import models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('stac_api', '0079_add_stac_extensions_to_meteoschweiz_collections'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='item', | ||
| name='cf_standard_name', | ||
| field=models.CharField( | ||
| blank=True, | ||
| help_text='Corresponds to the CF Standard Name from the CF Standard Name Table.', | ||
| max_length=255, | ||
| null=True | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='item', | ||
| name='unit', | ||
| field=models.CharField( | ||
| blank=True, help_text='Corresponds to the CF units.', max_length=255, null=True | ||
| ), | ||
| ), | ||
| ] |
47 changes: 47 additions & 0 deletions
47
...tac_api/migrations/0081_remove_item_update_collection_child_trigger_etag_only_and_more.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Generated by Django 5.2.13 on 2026-08-11 15:15 | ||
|
|
||
| import pgtrigger.compiler | ||
| import pgtrigger.migrations | ||
|
|
||
| from django.db import migrations | ||
| from django.db import models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('stac_api', '0080_item_cf_standard_name_item_unit'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| pgtrigger.migrations.RemoveTrigger( | ||
| model_name='item', | ||
| name='update_collection_child_trigger_etag_only', | ||
| ), | ||
| migrations.AddIndex( | ||
| model_name='item', | ||
| index=models.Index(fields=['cf_standard_name'], name='item_cf_standard_name_idx'), | ||
| ), | ||
| migrations.AddIndex( | ||
| model_name='item', | ||
| index=models.Index(fields=['unit'], name='item_unit_idx'), | ||
| ), | ||
| pgtrigger.migrations.AddTrigger( | ||
| model_name='item', | ||
| trigger=pgtrigger.compiler.Trigger( | ||
| name='update_collection_child_trigger_etag_only', | ||
| sql=pgtrigger.compiler.UpsertTriggerSql( | ||
| condition= | ||
| 'WHEN (OLD."cf_standard_name" IS DISTINCT FROM (NEW."cf_standard_name") OR OLD."collection_id" IS DISTINCT FROM (NEW."collection_id") OR OLD."created" IS DISTINCT FROM (NEW."created") OR OLD."etag" IS DISTINCT FROM (NEW."etag") OR OLD."forecast_duration" IS DISTINCT FROM (NEW."forecast_duration") OR OLD."forecast_horizon" IS DISTINCT FROM (NEW."forecast_horizon") OR OLD."forecast_perturbed" IS DISTINCT FROM (NEW."forecast_perturbed") OR OLD."forecast_reference_datetime" IS DISTINCT FROM (NEW."forecast_reference_datetime") OR OLD."forecast_variable" IS DISTINCT FROM (NEW."forecast_variable") OR OLD."geometry" IS DISTINCT FROM (NEW."geometry") OR OLD."id" IS DISTINCT FROM (NEW."id") OR OLD."name" IS DISTINCT FROM (NEW."name") OR OLD."properties_datetime" IS DISTINCT FROM (NEW."properties_datetime") OR OLD."properties_end_datetime" IS DISTINCT FROM (NEW."properties_end_datetime") OR OLD."properties_expires" IS DISTINCT FROM (NEW."properties_expires") OR OLD."properties_start_datetime" IS DISTINCT FROM (NEW."properties_start_datetime") OR OLD."properties_title" IS DISTINCT FROM (NEW."properties_title") OR OLD."stac_extensions" IS DISTINCT FROM (NEW."stac_extensions") OR OLD."total_data_size" IS DISTINCT FROM (NEW."total_data_size") OR OLD."unit" IS DISTINCT FROM (NEW."unit"))', | ||
| declare='DECLARE child stac_api_Item%ROWTYPE;', | ||
| func= | ||
| "\n-- update related collection\nchild = COALESCE(NEW, OLD);\nUPDATE stac_api_collection SET\n etag = public.gen_random_uuid()\nWHERE id = child.collection_id;\n\nRAISE INFO '%: updated collection.id=% due to Item.id=%',\n TG_NAME, child.collection_id, child.id;\n\nRETURN child;\n", | ||
| hash='0308e4b3217a2be3890fde8659088ee924d8c59a', | ||
| operation='UPDATE', | ||
| pgid='pgtrigger_update_collection_child_trigger_etag_only_bee6a', | ||
| table='stac_api_item', | ||
| when='AFTER' | ||
| ) | ||
| ), | ||
| ), | ||
| ] |
59 changes: 59 additions & 0 deletions
59
app/stac_api/migrations/0082_alter_collection_stac_extensions_enabled_and_more.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Generated by Django 5.2.13 on 2026-08-11 17:03 | ||
|
|
||
| import django.contrib.postgres.fields | ||
| from django.db import migrations | ||
| from django.db import models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('stac_api', '0081_remove_item_update_collection_child_trigger_etag_only_and_more'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name='collection', | ||
| name='stac_extensions_enabled', | ||
| field=django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.CharField( | ||
| choices=[( | ||
| 'https://stac-extensions.github.io/timestamps/v1.1.0/schema.json', | ||
| 'Timestamps' | ||
| ), | ||
| ( | ||
| 'https://stac-extensions.github.io/forecast/v0.2.0/schema.json', | ||
| 'Forecast' | ||
| ), ('https://stac-extensions.github.io/cf/v1.0.0/schema.json', 'CF')], | ||
| max_length=255 | ||
| ), | ||
| blank=True, | ||
| default=list, | ||
| help_text= | ||
| 'STAC extensions that are enabled for the Items in this Collection. It defines which STAC extensions are allowed to be used by the Items in this Collection. This field is for internal/admin use only, it is not exposed through the STAC API.', | ||
| size=None | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='item', | ||
| name='stac_extensions', | ||
| field=django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.CharField( | ||
| choices=[( | ||
| 'https://stac-extensions.github.io/timestamps/v1.1.0/schema.json', | ||
| 'Timestamps' | ||
| ), | ||
| ( | ||
| 'https://stac-extensions.github.io/forecast/v0.2.0/schema.json', | ||
| 'Forecast' | ||
| ), ('https://stac-extensions.github.io/cf/v1.0.0/schema.json', 'CF')], | ||
| max_length=255 | ||
| ), | ||
| blank=True, | ||
| default=list, | ||
| help_text= | ||
| "STAC extensions used by this Item. Defined as JSON schema URLs. Must be a subset of the Collection's stac_extensions_enabled field.", | ||
| size=None | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.