-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #332 from nsidc/render-null-performance-criticality
Render null performance criticality
- Loading branch information
Showing
12 changed files
with
114 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1 +1 @@ | ||
export USAON_BENEFIT_TOOL_VERSION="v2.2.0" | ||
export USAON_BENEFIT_TOOL_VERSION="v2.3.0" |
This file contains 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,24 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# HACK: Garrison doesn't see these variables that were exported in main deploy | ||
# script, which is unintuitive. NOTE that sourcing VERSION.env is not | ||
# compatible with integration, but this script doesn't receive the environment | ||
# as a parameter. Garrison needs some extra thought here. | ||
source /etc/profile.d/envvars.sh | ||
source VERSION.env | ||
|
||
# TODO: figure out better way | ||
echo "Waiting 10 seconds for the new stack to come up..." | ||
sleep 10 | ||
|
||
docker compose run --rm usaon-benefit-tool alembic upgrade head | ||
|
||
# confirm the expected migration was applied | ||
current=$(docker compose run --rm usaon-benefit-tool alembic current 2>/dev/null) | ||
if [ "ea1181510e10 (head)" = "${current}" ]; then | ||
echo "Data migration successful. On expected revision ${current}." | ||
else | ||
echo "Data migration failed. On unexpected revision ${current}." | ||
fi |
52 changes: 52 additions & 0 deletions
52
migrations/versions/ea1181510e10_allow_null_for_link_ratings.py
This file contains 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,52 @@ | ||
"""Allow null for link ratings. | ||
Revision ID: ea1181510e10 | ||
Revises: 925ed377e31b | ||
Create Date: 2024-10-02 21:27:47.043654 | ||
""" | ||
|
||
from collections.abc import Sequence | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'ea1181510e10' | ||
down_revision: str | None = '925ed377e31b' | ||
branch_labels: str | Sequence[str] | None = None | ||
depends_on: str | Sequence[str] | None = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
'link', | ||
'performance_rating', | ||
existing_type=sa.INTEGER(), | ||
nullable=True, | ||
) | ||
op.alter_column( | ||
'link', | ||
'criticality_rating', | ||
existing_type=sa.INTEGER(), | ||
nullable=True, | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
'link', | ||
'criticality_rating', | ||
existing_type=sa.INTEGER(), | ||
nullable=False, | ||
) | ||
op.alter_column( | ||
'link', | ||
'performance_rating', | ||
existing_type=sa.INTEGER(), | ||
nullable=False, | ||
) | ||
# ### end Alembic commands ### |
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[project] | ||
name = "usaon_benefit_tool" | ||
description = "Gather data for US AON's Value Tree Analysis (Benefit Tool) process" | ||
version = "2.2.0" | ||
version = "2.3.0" | ||
url = "[email protected]:nsidc/usaon-benefit-tool.git" | ||
authors = [ | ||
{name = "National Snow and Ice Data Center", email = "[email protected]"}, | ||
|
@@ -86,7 +86,7 @@ ignore = [ | |
"N806", | ||
] | ||
|
||
[tool.ruff.per-file-ignores] | ||
[tool.ruff.lint.per-file-ignores] | ||
# E501: Line too long. Long strings, e.g. URLs, are common in config. | ||
"usaon_benefit_tool/models/tables.py" = ["A003"] | ||
"tasks/format.py" = ["A001"] | ||
|
@@ -96,17 +96,17 @@ ignore = [ | |
"usaon_benefit_tool/__init__.py" = ["E501", "PLR0915"] | ||
"migrations/*" = ["INP001"] | ||
|
||
[tool.ruff.isort] | ||
[tool.ruff.lint.isort] | ||
known-third-party = ["luigi"] | ||
|
||
[tool.ruff.mccabe] | ||
[tool.ruff.lint.mccabe] | ||
max-complexity = 8 | ||
|
||
[tool.ruff.flake8-quotes] | ||
[tool.ruff.lint.flake8-quotes] | ||
inline-quotes = "double" | ||
|
||
[tool.bumpversion] | ||
current_version = "2.2.0" | ||
current_version = "2.3.0" | ||
commit = false | ||
tag = false | ||
|
||
|
This file contains 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 |
---|---|---|
|
@@ -16,3 +16,4 @@ | |
cmap.colors, # type: ignore [attr-defined] | ||
N=COLORMAP_CLASSES, | ||
) | ||
COLOR_NO_PERFORMANCE_RATING = "#666666" |
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = "2.2.0" | ||
VERSION = "2.3.0" |
This file contains 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 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 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 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