-
Notifications
You must be signed in to change notification settings - Fork 10
Obs doi #238
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
Draft
dhegedus99
wants to merge
3
commits into
Climate-REF:main
Choose a base branch
from
dhegedus99:obs_doi
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+151
−4
Draft
Obs doi #238
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
55 changes: 55 additions & 0 deletions
55
.../migrations/versions/2025-04-04T1601_c058c4ccf383_add_doi_and_tracking_id_to_metadata_.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,55 @@ | ||
| """add doi and tracking_id to metadata tracking | ||
|
|
||
| Revision ID: c058c4ccf383 | ||
| Revises: c5de99c14533 | ||
| Create Date: 2025-04-04 16:01:26.205824 | ||
|
|
||
| """ | ||
|
|
||
| from collections.abc import Sequence | ||
| from typing import Union | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision: str = "c058c4ccf383" | ||
| down_revision: Union[str, None] = "c5de99c14533" | ||
| branch_labels: Union[str, Sequence[str], None] = None | ||
| depends_on: Union[str, Sequence[str], None] = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| with op.batch_alter_table("metric_execution_result", schema=None) as batch_op: | ||
| batch_op.create_foreign_key( | ||
| "fk_metric_execution_result_metric_execution_group_id_metric_execution_group", # <-- Name added | ||
| "metric_execution_group", | ||
| ["metric_execution_group_id"], | ||
| ["id"], | ||
| ) | ||
|
|
||
| with op.batch_alter_table("obs4mips_dataset", schema=None) as batch_op: | ||
| batch_op.add_column(sa.Column("doi", sa.String(), nullable=True)) | ||
| batch_op.add_column(sa.Column("references", sa.String(), nullable=True)) | ||
| batch_op.add_column(sa.Column("tracking_id", sa.String(), nullable=True)) | ||
| batch_op.alter_column("variant_label", existing_type=sa.VARCHAR(), nullable=True) | ||
|
|
||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| with op.batch_alter_table("obs4mips_dataset", schema=None) as batch_op: | ||
| batch_op.alter_column("variant_label", existing_type=sa.VARCHAR(), nullable=False) | ||
| batch_op.drop_column("tracking_id") | ||
| batch_op.drop_column("references") | ||
| batch_op.drop_column("doi") | ||
|
|
||
| with op.batch_alter_table("metric_execution_result", schema=None) as batch_op: | ||
| batch_op.drop_constraint( | ||
| "fk_metric_execution_result_metric_execution_group_id_metric_execution_group", # <-- Name added | ||
| type_="foreignkey", | ||
| ) | ||
|
|
||
| # ### end Alembic commands ### |
37 changes: 37 additions & 0 deletions
37
...igrations/versions/2025-04-04T1624_dc2393b21436_add_uncertainty_information_attributes.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,37 @@ | ||
| """add uncertainty information attributes | ||
|
|
||
| Revision ID: dc2393b21436 | ||
| Revises: c058c4ccf383 | ||
| Create Date: 2025-04-04 16:24:14.505451 | ||
|
|
||
| """ | ||
|
|
||
| from collections.abc import Sequence | ||
| from typing import Union | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision: str = "dc2393b21436" | ||
| down_revision: Union[str, None] = "c058c4ccf383" | ||
| branch_labels: Union[str, Sequence[str], None] = None | ||
| depends_on: Union[str, Sequence[str], None] = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| with op.batch_alter_table("obs4mips_dataset", schema=None) as batch_op: | ||
| batch_op.add_column(sa.Column("has_auxdata", sa.String(), nullable=True)) | ||
| batch_op.add_column(sa.Column("aux_variable_id", sa.String(), nullable=True)) | ||
|
|
||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| with op.batch_alter_table("obs4mips_dataset", schema=None) as batch_op: | ||
| batch_op.drop_column("aux_variable_id") | ||
| batch_op.drop_column("has_auxdata") | ||
|
|
||
| # ### end Alembic commands ### |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably track the tracking id for CMIP6 datasets as well