Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Remove agencies.ds_last_updated_at

Revision ID: 9a56916ea7d8
Revises: c14d669d7c0d
Create Date: 2025-08-11 09:31:18.268319

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '9a56916ea7d8'
down_revision: Union[str, None] = 'c14d669d7c0d'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None

COLUMN_NAME = "ds_last_updated_at"
TABLE_NAME = "agencies"

def upgrade() -> None:

Check warning on line 23 in alembic/versions/2025_08_11_0931-9a56916ea7d8_remove_agencies_ds_last_updated_at.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] alembic/versions/2025_08_11_0931-9a56916ea7d8_remove_agencies_ds_last_updated_at.py#L23 <103>

Missing docstring in public function
Raw output
./alembic/versions/2025_08_11_0931-9a56916ea7d8_remove_agencies_ds_last_updated_at.py:23:1: D103 Missing docstring in public function
op.drop_column(TABLE_NAME, COLUMN_NAME)


def downgrade() -> None:

Check warning on line 27 in alembic/versions/2025_08_11_0931-9a56916ea7d8_remove_agencies_ds_last_updated_at.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] alembic/versions/2025_08_11_0931-9a56916ea7d8_remove_agencies_ds_last_updated_at.py#L27 <103>

Missing docstring in public function
Raw output
./alembic/versions/2025_08_11_0931-9a56916ea7d8_remove_agencies_ds_last_updated_at.py:27:1: D103 Missing docstring in public function
op.add_column(
table_name=TABLE_NAME,
column=sa.Column(COLUMN_NAME, sa.DateTime(), nullable=False),
)
1 change: 0 additions & 1 deletion src/db/models/instantiations/agency/pydantic/upsert.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ def sa_model(cls) -> type[Base]:
state: str | None
county: str | None
locality: str | None
ds_last_updated_at: datetime
5 changes: 0 additions & 5 deletions src/db/models/instantiations/agency/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ class Agency(
state = Column(String, nullable=True)
county = Column(String, nullable=True)
locality = Column(String, nullable=True)
ds_last_updated_at = Column(
DateTime,
nullable=True,
comment="The last time the agency was updated in the data sources database."
)

# Relationships
automated_suggestions = relationship("AutomatedUrlAgencySuggestion", back_populates="agency")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ def check(
assert info.state_name == agency.state
assert info.county_name == agency.county
assert info.locality_name == agency.locality
assert info.updated_at == agency.ds_last_updated_at
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@
# Neither should be updated with new values
checker = AgencyChecker()
for agency in agencies:
with pytest.raises(AssertionError):
checker.check(agency)
checker.check(agency)

Check warning on line 53 in tests/automated/integration/tasks/scheduled/impl/sync/agency/test_no_new_results.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] tests/automated/integration/tasks/scheduled/impl/sync/agency/test_no_new_results.py#L53 <292>

no newline at end of file
Raw output
./tests/automated/integration/tasks/scheduled/impl/sync/agency/test_no_new_results.py:53:30: W292 no newline at end of file