Skip to content

Commit

Permalink
Rm is uploaded to vogue (#2810) (major)
Browse files Browse the repository at this point in the history
### Changed

- Remove uploaded to vogue from the database and models
  • Loading branch information
henrikstranneheim authored Jan 9, 2024
1 parent e4af029 commit 5b7f8d5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""remove_uploaded_to_vogue_at
Revision ID: 584840c706a0
Revises: 27ec5c4c0380
Create Date: 2023-12-27 11:50:22.278213
"""
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "584840c706a0"
down_revision = "27ec5c4c0380"
branch_labels = None
depends_on = None


def upgrade():
op.drop_column("analysis", "uploaded_to_vogue_at")


def downgrade():
op.add_column("analysis", sa.Column("uploaded_to_vogue_at", sa.DateTime(), nullable=True))
1 change: 0 additions & 1 deletion cg/store/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class Analysis(Model):

created_at = Column(types.DateTime, default=dt.datetime.now, nullable=False)
case_id = Column(ForeignKey("case.id", ondelete="CASCADE"), nullable=False)
uploaded_to_vogue_at = Column(types.DateTime, nullable=True)

case = orm.relationship("Case", back_populates="analyses")

Expand Down
8 changes: 0 additions & 8 deletions tests/store/api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ def store_with_analyses_for_cases(
started_at=timestamp_yesterday,
uploaded_at=timestamp_yesterday,
delivery_reported_at=None,
uploaded_to_vogue_at=timestamp_yesterday,
completed_at=timestamp_yesterday,
)
helpers.add_analysis(
Expand All @@ -474,7 +473,6 @@ def store_with_analyses_for_cases(
started_at=timestamp_now,
uploaded_at=timestamp_now,
delivery_reported_at=None,
uploaded_to_vogue_at=None,
completed_at=timestamp_now,
)
sample = helpers.add_sample(analysis_store, delivered_at=timestamp_now)
Expand Down Expand Up @@ -505,7 +503,6 @@ def store_with_analyses_for_cases_not_uploaded_fluffy(
started_at=timestamp_yesterday,
uploaded_at=timestamp_yesterday,
delivery_reported_at=None,
uploaded_to_vogue_at=timestamp_yesterday,
pipeline=Pipeline.FLUFFY,
)
helpers.add_analysis(
Expand All @@ -514,7 +511,6 @@ def store_with_analyses_for_cases_not_uploaded_fluffy(
started_at=timestamp_now,
uploaded_at=None,
delivery_reported_at=None,
uploaded_to_vogue_at=timestamp_now,
pipeline=Pipeline.FLUFFY,
)
sample = helpers.add_sample(analysis_store, delivered_at=timestamp_now)
Expand Down Expand Up @@ -545,7 +541,6 @@ def store_with_analyses_for_cases_not_uploaded_microsalt(
started_at=timestamp_yesterday,
uploaded_at=timestamp_yesterday,
delivery_reported_at=None,
uploaded_to_vogue_at=timestamp_yesterday,
pipeline=Pipeline.MICROSALT,
)
helpers.add_analysis(
Expand All @@ -554,7 +549,6 @@ def store_with_analyses_for_cases_not_uploaded_microsalt(
started_at=timestamp_now,
uploaded_at=None,
delivery_reported_at=None,
uploaded_to_vogue_at=timestamp_now,
pipeline=Pipeline.MICROSALT,
)
sample = helpers.add_sample(analysis_store, delivered_at=timestamp_now)
Expand Down Expand Up @@ -584,7 +578,6 @@ def store_with_analyses_for_cases_to_deliver(
started_at=timestamp_yesterday,
uploaded_at=None,
delivery_reported_at=None,
uploaded_to_vogue_at=timestamp_yesterday,
completed_at=timestamp_yesterday,
pipeline=Pipeline.FLUFFY,
)
Expand All @@ -594,7 +587,6 @@ def store_with_analyses_for_cases_to_deliver(
started_at=timestamp_now,
uploaded_at=None,
delivery_reported_at=None,
uploaded_to_vogue_at=None,
completed_at=timestamp_now,
pipeline=Pipeline.MIP_DNA,
)
Expand Down
4 changes: 0 additions & 4 deletions tests/store/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ def store_with_older_and_newer_analyses(
"""Return a store with older and newer analyses."""
analysis = base_store._get_query(table=Analysis).first()
analysis.uploaded_at = timestamp_now
analysis.uploaded_to_vogue_at = timestamp_now
analysis.cleaned_at = timestamp_now
analysis.started_at = timestamp_now
analysis.completed_at = timestamp_now
Expand All @@ -416,7 +415,6 @@ def store_with_older_and_newer_analyses(
started_at=time,
completed_at=time,
uploaded_at=time,
uploaded_to_vogue_at=time,
cleaned_at=time,
)

Expand All @@ -442,15 +440,13 @@ def store_with_analyses_for_cases(
started_at=timestamp_yesterday,
uploaded_at=timestamp_yesterday,
delivery_reported_at=None,
uploaded_to_vogue_at=timestamp_yesterday,
)
helpers.add_analysis(
analysis_store,
case=case,
started_at=timestamp_now,
uploaded_at=timestamp_now,
delivery_reported_at=None,
uploaded_to_vogue_at=timestamp_now,
)
sample = helpers.add_sample(analysis_store, delivered_at=timestamp_now)
link: CaseSample = analysis_store.relate_sample(
Expand Down
3 changes: 0 additions & 3 deletions tests/store_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ def add_analysis(
data_delivery: DataDelivery = DataDelivery.FASTQ_QC,
uploading: bool = False,
config_path: str = None,
uploaded_to_vogue_at: datetime = None,
) -> Analysis:
"""Utility function to add an analysis for tests."""

Expand All @@ -346,8 +345,6 @@ def add_analysis(
analysis.config_path = config_path
if pipeline:
analysis.pipeline = str(pipeline)
if uploaded_to_vogue_at:
analysis.uploaded_to_vogue_at = uploaded_to_vogue_at

analysis.limitations = "A limitation"
analysis.case = case
Expand Down

0 comments on commit 5b7f8d5

Please sign in to comment.