From 83d88d50a69a7e78487cd2c51f2fe6510822040c Mon Sep 17 00:00:00 2001 From: Max Chis Date: Sun, 10 Aug 2025 21:01:08 -0400 Subject: [PATCH] Change `url.outcome` to `url.status` --- ...0660c5_change_url_outcome_to_url_status.py | 26 +++++++++++++++++ .../queries/get_annotation_batch_info.py | 2 +- .../get_next_url_for_user_annotation.py | 2 +- .../agency/get/queries/next_for_annotation.py | 2 +- src/api/endpoints/annotate/all/get/query.py | 2 +- src/api/endpoints/collector/manual/query.py | 2 +- .../metrics/batches/aggregated/query.py | 2 +- .../metrics/batches/breakdown/query.py | 2 +- .../endpoints/review/approve/query_/core.py | 2 +- src/api/endpoints/review/next/query.py | 6 ++-- src/api/endpoints/review/reject/query.py | 6 ++-- src/api/endpoints/task/by_id/query.py | 2 +- src/api/endpoints/url/get/query.py | 2 +- src/collectors/queries/insert/url.py | 2 +- .../huggingface/queries/check/requester.py | 2 +- .../impl/huggingface/queries/get/core.py | 4 +-- .../sync/data_sources/queries/upsert/core.py | 4 ++- .../queries/upsert/helpers/convert.py | 4 +-- .../queries/upsert/url/insert/params.py | 2 +- .../queries/upsert/url/update/params.py | 2 +- ...pending_urls_without_agency_suggestions.py | 2 +- .../has_urls_without_agency_suggestions.py | 2 +- .../auto_relevant/queries/get_tdos.py | 2 +- .../tasks/url/operators/html/queries/get.py | 2 +- .../operators/submit_approved/queries/get.py | 2 +- .../submit_approved/queries/has_validated.py | 2 +- .../submit_approved/queries/mark_submitted.py | 2 +- src/db/client/async_.py | 28 +++++++++---------- src/db/client/sync.py | 4 +-- .../instantiations/url/core/pydantic/info.py | 2 +- .../url/core/pydantic/insert.py | 2 +- .../instantiations/url/core/sqlalchemy.py | 2 +- .../core/common/annotation_exists.py | 2 +- .../url_counts/builder.py | 4 +-- .../core/metrics/urls/aggregated/pending.py | 2 +- src/db/statement_composer.py | 8 +++--- .../api/review/rejection/helpers.py | 2 +- .../test_approve_and_get_next_source.py | 4 +-- .../db/client/approve_url/test_basic.py | 2 +- .../scheduled/impl/huggingface/setup/data.py | 10 +++---- .../impl/huggingface/setup/models/input.py | 2 +- .../impl/huggingface/setup/queries/setup.py | 2 +- .../setup/manager/queries/check.py | 2 +- .../sync/data_sources/setup/manager/url.py | 2 +- .../tasks/url/impl/auto_relevant/test_task.py | 2 +- .../impl/duplicate/test_url_duplicate_task.py | 2 +- .../tasks/url/impl/html/check/manager.py | 2 +- .../tasks/url/impl/html/setup/manager.py | 2 +- .../tasks/url/impl/probe/check/manager.py | 2 +- .../tasks/url/impl/probe/setup/manager.py | 2 +- .../test_submit_approved_url_task.py | 6 ++-- .../tasks/url/impl/test_url_404_probe.py | 8 +++--- .../data_creator/commands/impl/urls.py | 10 +++---- .../commands/impl/urls_v2/core.py | 2 +- tests/helpers/data_creator/core.py | 2 +- tests/helpers/setup/populate.py | 2 +- 56 files changed, 121 insertions(+), 93 deletions(-) create mode 100644 alembic/versions/2025_08_10_2046-5930e70660c5_change_url_outcome_to_url_status.py diff --git a/alembic/versions/2025_08_10_2046-5930e70660c5_change_url_outcome_to_url_status.py b/alembic/versions/2025_08_10_2046-5930e70660c5_change_url_outcome_to_url_status.py new file mode 100644 index 00000000..c24d5ac8 --- /dev/null +++ b/alembic/versions/2025_08_10_2046-5930e70660c5_change_url_outcome_to_url_status.py @@ -0,0 +1,26 @@ +"""Change URL outcome to URL status + +Revision ID: 5930e70660c5 +Revises: 11ece61d7ac2 +Create Date: 2025-08-10 20:46:58.576623 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = '5930e70660c5' +down_revision: Union[str, None] = '11ece61d7ac2' +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + op.alter_column('urls', 'outcome', new_column_name='status') + + +def downgrade() -> None: + op.alter_column('urls', 'status', new_column_name='outcome') diff --git a/src/api/endpoints/annotate/_shared/queries/get_annotation_batch_info.py b/src/api/endpoints/annotate/_shared/queries/get_annotation_batch_info.py index 31b858c5..4e29e2f3 100644 --- a/src/api/endpoints/annotate/_shared/queries/get_annotation_batch_info.py +++ b/src/api/endpoints/annotate/_shared/queries/get_annotation_batch_info.py @@ -42,7 +42,7 @@ async def run( ) common_where_clause = [ - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, LinkBatchURL.batch_id == self.batch_id, ] diff --git a/src/api/endpoints/annotate/_shared/queries/get_next_url_for_user_annotation.py b/src/api/endpoints/annotate/_shared/queries/get_next_url_for_user_annotation.py index 50b77d0a..8e41373a 100644 --- a/src/api/endpoints/annotate/_shared/queries/get_next_url_for_user_annotation.py +++ b/src/api/endpoints/annotate/_shared/queries/get_next_url_for_user_annotation.py @@ -43,7 +43,7 @@ async def run(self, session: AsyncSession): query = ( query - .where(URL.outcome == URLStatus.PENDING.value) + .where(URL.status == URLStatus.PENDING.value) # URL must not have user suggestion .where( StatementComposer.user_suggestion_not_exists(self.user_suggestion_model_to_exclude) diff --git a/src/api/endpoints/annotate/agency/get/queries/next_for_annotation.py b/src/api/endpoints/annotate/agency/get/queries/next_for_annotation.py index 66a5e3fb..d529616b 100644 --- a/src/api/endpoints/annotate/agency/get/queries/next_for_annotation.py +++ b/src/api/endpoints/annotate/agency/get/queries/next_for_annotation.py @@ -48,7 +48,7 @@ async def run( # Must not have confirmed agencies query = query.where( - URL.outcome == URLStatus.PENDING.value + URL.status == URLStatus.PENDING.value ) diff --git a/src/api/endpoints/annotate/all/get/query.py b/src/api/endpoints/annotate/all/get/query.py index 2db7191a..a9e39753 100644 --- a/src/api/endpoints/annotate/all/get/query.py +++ b/src/api/endpoints/annotate/all/get/query.py @@ -39,7 +39,7 @@ async def run( query .where( and_( - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, StatementComposer.user_suggestion_not_exists(UserUrlAgencySuggestion), StatementComposer.user_suggestion_not_exists(UserRecordTypeSuggestion), StatementComposer.user_suggestion_not_exists(UserRelevantSuggestion), diff --git a/src/api/endpoints/collector/manual/query.py b/src/api/endpoints/collector/manual/query.py index 5dcd3977..9280fdb9 100644 --- a/src/api/endpoints/collector/manual/query.py +++ b/src/api/endpoints/collector/manual/query.py @@ -47,7 +47,7 @@ async def run(self, session: AsyncSession) -> ManualBatchResponseDTO: name=entry.name, description=entry.description, collector_metadata=entry.collector_metadata, - outcome=URLStatus.PENDING.value, + status=URLStatus.PENDING.value, record_type=entry.record_type.value if entry.record_type is not None else None, source=URLSource.MANUAL ) diff --git a/src/api/endpoints/metrics/batches/aggregated/query.py b/src/api/endpoints/metrics/batches/aggregated/query.py index 8d5f0f56..a6c6c3df 100644 --- a/src/api/endpoints/metrics/batches/aggregated/query.py +++ b/src/api/endpoints/metrics/batches/aggregated/query.py @@ -43,7 +43,7 @@ def url_column(status: URLStatus, label): return sc.count_distinct( case( ( - URL.outcome == status.value, + URL.status == status.value, URL.id ) ), diff --git a/src/api/endpoints/metrics/batches/breakdown/query.py b/src/api/endpoints/metrics/batches/breakdown/query.py index ad15c398..2d4b50e7 100644 --- a/src/api/endpoints/metrics/batches/breakdown/query.py +++ b/src/api/endpoints/metrics/batches/breakdown/query.py @@ -36,7 +36,7 @@ def url_column(status: URLStatus, label): return sc.count_distinct( case( ( - URL.outcome == status.value, + URL.status == status.value, URL.id ) ), diff --git a/src/api/endpoints/review/approve/query_/core.py b/src/api/endpoints/review/approve/query_/core.py index 2d43dd6b..eeea3da1 100644 --- a/src/api/endpoints/review/approve/query_/core.py +++ b/src/api/endpoints/review/approve/query_/core.py @@ -95,7 +95,7 @@ async def run(self, session: AsyncSession) -> None: # If it does, do nothing - url.outcome = URLStatus.VALIDATED.value + url.status = URLStatus.VALIDATED.value update_if_not_none(url, "name", self.approval_info.name, required=True) update_if_not_none(url, "description", self.approval_info.description, required=False) diff --git a/src/api/endpoints/review/next/query.py b/src/api/endpoints/review/next/query.py index d89aa4da..e2de4f07 100644 --- a/src/api/endpoints/review/next/query.py +++ b/src/api/endpoints/review/next/query.py @@ -93,7 +93,7 @@ def _build_base_query( query = ( query.where( and_( - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, *where_exist_clauses ) ) @@ -189,7 +189,7 @@ async def get_count_ready_query(self): ) .where( LinkBatchURL.batch_id == self.batch_id, - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, *self._get_where_exist_clauses( builder.query ) @@ -209,7 +209,7 @@ async def get_count_reviewed_query(self): .join(LinkBatchURL) .outerjoin(URL, URL.id == LinkBatchURL.url_id) .where( - URL.outcome.in_( + URL.status.in_( [ URLStatus.VALIDATED.value, URLStatus.NOT_RELEVANT.value, diff --git a/src/api/endpoints/review/reject/query.py b/src/api/endpoints/review/reject/query.py index e7afa439..00bf26d3 100644 --- a/src/api/endpoints/review/reject/query.py +++ b/src/api/endpoints/review/reject/query.py @@ -35,11 +35,11 @@ async def run(self, session) -> None: match self.rejection_reason: case RejectionReason.INDIVIDUAL_RECORD: - url.outcome = URLStatus.INDIVIDUAL_RECORD.value + url.status = URLStatus.INDIVIDUAL_RECORD.value case RejectionReason.BROKEN_PAGE_404: - url.outcome = URLStatus.NOT_FOUND.value + url.status = URLStatus.NOT_FOUND.value case RejectionReason.NOT_RELEVANT: - url.outcome = URLStatus.NOT_RELEVANT.value + url.status = URLStatus.NOT_RELEVANT.value case _: raise HTTPException( status_code=HTTP_400_BAD_REQUEST, diff --git a/src/api/endpoints/task/by_id/query.py b/src/api/endpoints/task/by_id/query.py index c2b32234..e66001f5 100644 --- a/src/api/endpoints/task/by_id/query.py +++ b/src/api/endpoints/task/by_id/query.py @@ -43,7 +43,7 @@ async def run(self, session: AsyncSession) -> TaskInfo: batch_id=url.batch.id, url=url.url, collector_metadata=url.collector_metadata, - outcome=URLStatus(url.outcome), + status=URLStatus(url.status), updated_at=url.updated_at ) url_infos.append(url_info) diff --git a/src/api/endpoints/url/get/query.py b/src/api/endpoints/url/get/query.py index 8bdb97bd..b7ef6119 100644 --- a/src/api/endpoints/url/get/query.py +++ b/src/api/endpoints/url/get/query.py @@ -51,7 +51,7 @@ async def run(self, session: AsyncSession) -> GetURLsResponseInfo: id=result.id, batch_id=result.batch.id if result.batch is not None else None, url=result.url, - status=URLStatus(result.outcome), + status=URLStatus(result.status), collector_metadata=result.collector_metadata, updated_at=result.updated_at, created_at=result.created_at, diff --git a/src/collectors/queries/insert/url.py b/src/collectors/queries/insert/url.py index 44e7c612..f8c2bc75 100644 --- a/src/collectors/queries/insert/url.py +++ b/src/collectors/queries/insert/url.py @@ -18,7 +18,7 @@ async def run(self, session: AsyncSession) -> int: url_entry = URL( url=self.url_info.url, collector_metadata=self.url_info.collector_metadata, - outcome=self.url_info.outcome.value, + status=self.url_info.status.value, source=self.url_info.source ) if self.url_info.created_at is not None: diff --git a/src/core/tasks/scheduled/impl/huggingface/queries/check/requester.py b/src/core/tasks/scheduled/impl/huggingface/queries/check/requester.py index 33a79043..a349233c 100644 --- a/src/core/tasks/scheduled/impl/huggingface/queries/check/requester.py +++ b/src/core/tasks/scheduled/impl/huggingface/queries/check/requester.py @@ -35,7 +35,7 @@ async def has_valid_urls(self, last_upload_at: datetime | None) -> bool: URL.id == URLCompressedHTML.url_id ) .where( - URL.outcome.in_( + URL.status.in_( [ URLStatus.VALIDATED, URLStatus.NOT_RELEVANT.value, diff --git a/src/core/tasks/scheduled/impl/huggingface/queries/get/core.py b/src/core/tasks/scheduled/impl/huggingface/queries/get/core.py index 90d448dc..27f206b7 100644 --- a/src/core/tasks/scheduled/impl/huggingface/queries/get/core.py +++ b/src/core/tasks/scheduled/impl/huggingface/queries/get/core.py @@ -26,7 +26,7 @@ async def run(self, session: AsyncSession) -> list[GetForLoadingToHuggingFaceOut select( URL.id.label(label_url_id), URL.url.label(label_url), - URL.outcome.label(label_url_status), + URL.status.label(label_url_status), URL.record_type.label(label_record_type_fine), URLCompressedHTML.compressed_html.label(label_html) ) @@ -35,7 +35,7 @@ async def run(self, session: AsyncSession) -> list[GetForLoadingToHuggingFaceOut URL.id == URLCompressedHTML.url_id ) .where( - URL.outcome.in_([ + URL.status.in_([ URLStatus.VALIDATED, URLStatus.NOT_RELEVANT, URLStatus.SUBMITTED diff --git a/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/core.py b/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/core.py index 44737be7..751192f9 100644 --- a/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/core.py +++ b/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/core.py @@ -9,6 +9,8 @@ from src.core.tasks.scheduled.impl.sync.data_sources.queries.upsert.param_manager import \ UpsertURLsFromDataSourcesParamManager from src.core.tasks.scheduled.impl.sync.data_sources.queries.upsert.requester import UpsertURLsFromDataSourcesDBRequester +from src.core.tasks.scheduled.impl.sync.data_sources.queries.upsert.url.insert.params import \ + InsertURLForDataSourcesSyncParams from src.core.tasks.scheduled.impl.sync.data_sources.queries.upsert.url.lookup.response import \ LookupURLForDataSourcesSyncResponse from src.db.dtos.url.mapping import URLMapping @@ -84,7 +86,7 @@ async def _add_new_data_sources(self, url_mappings: list[URLMapping]): await self.requester.add_new_data_sources(url_ds_insert_params) async def _add_new_urls(self, urls: list[str]): - url_insert_params = self.param_manager.add_new_urls(urls) + url_insert_params: list[InsertURLForDataSourcesSyncParams] = self.param_manager.add_new_urls(urls) url_mappings = await self.requester.add_new_urls(url_insert_params) return url_mappings diff --git a/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/helpers/convert.py b/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/helpers/convert.py index d26b51b1..3240e409 100644 --- a/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/helpers/convert.py +++ b/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/helpers/convert.py @@ -41,7 +41,7 @@ def convert_to_url_update_params( id=url_id, name=sync_info.name, description=sync_info.description, - outcome=convert_to_source_collector_url_status( + status=convert_to_source_collector_url_status( ds_url_status=sync_info.url_status, ds_approval_status=sync_info.approval_status ), @@ -56,7 +56,7 @@ def convert_to_url_insert_params( url=url, name=sync_info.name, description=sync_info.description, - outcome=convert_to_source_collector_url_status( + status=convert_to_source_collector_url_status( ds_url_status=sync_info.url_status, ds_approval_status=sync_info.approval_status ), diff --git a/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/url/insert/params.py b/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/url/insert/params.py index f0e4a570..2be5d539 100644 --- a/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/url/insert/params.py +++ b/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/url/insert/params.py @@ -9,7 +9,7 @@ class InsertURLForDataSourcesSyncParams(BulkInsertableModel): url: str name: str description: str | None - outcome: URLStatus + status: URLStatus record_type: RecordType source: URLSource = URLSource.DATA_SOURCES diff --git a/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/url/update/params.py b/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/url/update/params.py index fb8a9d64..0bbf0be2 100644 --- a/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/url/update/params.py +++ b/src/core/tasks/scheduled/impl/sync/data_sources/queries/upsert/url/update/params.py @@ -17,5 +17,5 @@ def sa_model(cls) -> type[URL]: id: int name: str description: str | None - outcome: URLStatus + status: URLStatus record_type: RecordType diff --git a/src/core/tasks/url/operators/agency_identification/queries/get_pending_urls_without_agency_suggestions.py b/src/core/tasks/url/operators/agency_identification/queries/get_pending_urls_without_agency_suggestions.py index 63ade865..521fa8c0 100644 --- a/src/core/tasks/url/operators/agency_identification/queries/get_pending_urls_without_agency_suggestions.py +++ b/src/core/tasks/url/operators/agency_identification/queries/get_pending_urls_without_agency_suggestions.py @@ -21,7 +21,7 @@ async def run(self, session: AsyncSession) -> list[AgencyIdentificationTDO]: Batch.strategy ) .select_from(URL) - .where(URL.outcome == URLStatus.PENDING.value) + .where(URL.status == URLStatus.PENDING.value) .outerjoin(LinkBatchURL) .outerjoin(Batch) ) diff --git a/src/core/tasks/url/operators/agency_identification/queries/has_urls_without_agency_suggestions.py b/src/core/tasks/url/operators/agency_identification/queries/has_urls_without_agency_suggestions.py index 88e3c828..ab5429fb 100644 --- a/src/core/tasks/url/operators/agency_identification/queries/has_urls_without_agency_suggestions.py +++ b/src/core/tasks/url/operators/agency_identification/queries/has_urls_without_agency_suggestions.py @@ -17,7 +17,7 @@ async def run( select( URL.id ).where( - URL.outcome == URLStatus.PENDING.value + URL.status == URLStatus.PENDING.value ) ) diff --git a/src/core/tasks/url/operators/auto_relevant/queries/get_tdos.py b/src/core/tasks/url/operators/auto_relevant/queries/get_tdos.py index 2ec72836..1a5fafc1 100644 --- a/src/core/tasks/url/operators/auto_relevant/queries/get_tdos.py +++ b/src/core/tasks/url/operators/auto_relevant/queries/get_tdos.py @@ -29,7 +29,7 @@ async def run(self, session: AsyncSession) -> list[URLRelevantTDO]: ) .join(URLCompressedHTML) .where( - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, ) ) query = StatementComposer.exclude_urls_with_extant_model( diff --git a/src/core/tasks/url/operators/html/queries/get.py b/src/core/tasks/url/operators/html/queries/get.py index d09f8bca..8ea70bed 100644 --- a/src/core/tasks/url/operators/html/queries/get.py +++ b/src/core/tasks/url/operators/html/queries/get.py @@ -21,7 +21,7 @@ async def run(self, session: AsyncSession) -> list[URLInfo]: batch_id=url.batch.id if url.batch is not None else None, url=url.url, collector_metadata=url.collector_metadata, - outcome=url.outcome, + status=url.status, created_at=url.created_at, updated_at=url.updated_at, name=url.name diff --git a/src/core/tasks/url/operators/submit_approved/queries/get.py b/src/core/tasks/url/operators/submit_approved/queries/get.py index db128326..484a9aec 100644 --- a/src/core/tasks/url/operators/submit_approved/queries/get.py +++ b/src/core/tasks/url/operators/submit_approved/queries/get.py @@ -29,7 +29,7 @@ async def _process_results(self, urls): async def _build_query(): query = ( select(URL) - .where(URL.outcome == URLStatus.VALIDATED.value) + .where(URL.status == URLStatus.VALIDATED.value) .options( selectinload(URL.optional_data_source_metadata), selectinload(URL.confirmed_agencies), diff --git a/src/core/tasks/url/operators/submit_approved/queries/has_validated.py b/src/core/tasks/url/operators/submit_approved/queries/has_validated.py index 9a5c4b51..7c2d0509 100644 --- a/src/core/tasks/url/operators/submit_approved/queries/has_validated.py +++ b/src/core/tasks/url/operators/submit_approved/queries/has_validated.py @@ -11,7 +11,7 @@ class HasValidatedURLsQueryBuilder(QueryBuilderBase): async def run(self, session: AsyncSession) -> bool: query = ( select(URL) - .where(URL.outcome == URLStatus.VALIDATED.value) + .where(URL.status == URLStatus.VALIDATED.value) ) urls = await session.execute(query) urls = urls.scalars().all() diff --git a/src/core/tasks/url/operators/submit_approved/queries/mark_submitted.py b/src/core/tasks/url/operators/submit_approved/queries/mark_submitted.py index 347fba11..e1f9e382 100644 --- a/src/core/tasks/url/operators/submit_approved/queries/mark_submitted.py +++ b/src/core/tasks/url/operators/submit_approved/queries/mark_submitted.py @@ -23,7 +23,7 @@ async def run(self, session: AsyncSession): update(URL) .where(URL.id == url_id) .values( - outcome=URLStatus.SUBMITTED.value + status=URLStatus.SUBMITTED.value ) ) diff --git a/src/db/client/async_.py b/src/db/client/async_.py index 40a0a4e1..136fea8a 100644 --- a/src/db/client/async_.py +++ b/src/db/client/async_.py @@ -467,7 +467,7 @@ async def add_url_error_infos(self, session: AsyncSession, url_error_infos: list statement = select(URL).where(URL.id == url_error_info.url_id) scalar_result = await session.scalars(statement) url = scalar_result.first() - url.outcome = URLStatus.ERROR.value + url.status = URLStatus.ERROR.value url_error = URLErrorInfo(**url_error_info.model_dump()) session.add(url_error) @@ -476,7 +476,7 @@ async def add_url_error_infos(self, session: AsyncSession, url_error_infos: list async def get_urls_with_errors(self, session: AsyncSession) -> list[URLErrorPydanticInfo]: statement = (select(URL, URLErrorInfo.error, URLErrorInfo.updated_at, URLErrorInfo.task_id) .join(URLErrorInfo) - .where(URL.outcome == URLStatus.ERROR.value) + .where(URL.status == URLStatus.ERROR.value) .order_by(URL.id)) scalar_result = await session.execute(statement) results = scalar_result.all() @@ -550,7 +550,7 @@ async def get_urls_with_html_data_and_without_models( ): statement = (select(URL) .options(selectinload(URL.html_content)) - .where(URL.outcome == URLStatus.PENDING.value)) + .where(URL.status == URLStatus.PENDING.value)) statement = self.statement_composer.exclude_urls_with_extant_model( statement=statement, model=model @@ -579,7 +579,7 @@ async def has_urls_with_html_data_and_without_models( ) -> bool: statement = (select(URL) .join(URLCompressedHTML) - .where(URL.outcome == URLStatus.PENDING.value)) + .where(URL.status == URLStatus.PENDING.value)) # Exclude URLs with auto suggested record types statement = self.statement_composer.exclude_urls_with_extant_model( statement=statement, @@ -1143,7 +1143,7 @@ async def get_urls_aggregated_metrics( URL.id, URL.created_at ).where( - URL.outcome == URLStatus.PENDING.value + URL.status == URLStatus.PENDING.value ).order_by( URL.created_at.asc() ).limit(1) @@ -1161,7 +1161,7 @@ def case_column(status: URLStatus, label): return sc.count_distinct( case( ( - URL.outcome == status.value, + URL.status == status.value, URL.id ) ), @@ -1239,7 +1239,7 @@ async def get_urls_breakdown_pending_metrics( ).label('user_agency_count'), ) .outerjoin(flags, flags.c.url_id == URL.id) - .where(URL.outcome == URLStatus.PENDING.value) + .where(URL.status == URLStatus.PENDING.value) .group_by(month) .order_by(month.asc()) ) @@ -1321,7 +1321,7 @@ async def populate_backlog_snapshot( query = select( sc.count_distinct(URL.id, label="count") ).where( - URL.outcome == URLStatus.PENDING.value + URL.status == URLStatus.PENDING.value ) raw_result = await session.execute(query) @@ -1344,7 +1344,7 @@ async def has_pending_urls_not_checked_for_duplicates(self, session: AsyncSessio URLCheckedForDuplicate, URL.id == URLCheckedForDuplicate.url_id ).where( - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, URLCheckedForDuplicate.id == None ).limit(1) ) @@ -1361,7 +1361,7 @@ async def get_pending_urls_not_checked_for_duplicates(self, session: AsyncSessio URLCheckedForDuplicate, URL.id == URLCheckedForDuplicate.url_id ).where( - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, URLCheckedForDuplicate.id == None ).limit(100) ) @@ -1371,11 +1371,11 @@ async def get_pending_urls_not_checked_for_duplicates(self, session: AsyncSessio return [URLDuplicateTDO(url=url.url, url_id=url.id) for url in urls] async def mark_all_as_duplicates(self, url_ids: List[int]): - query = update(URL).where(URL.id.in_(url_ids)).values(outcome=URLStatus.DUPLICATE.value) + query = update(URL).where(URL.id.in_(url_ids)).values(status=URLStatus.DUPLICATE.value) await self.execute(query) async def mark_all_as_404(self, url_ids: List[int]): - query = update(URL).where(URL.id.in_(url_ids)).values(outcome=URLStatus.NOT_FOUND.value) + query = update(URL).where(URL.id.in_(url_ids)).values(status=URLStatus.NOT_FOUND.value) await self.execute(query) query = update(URLWebMetadata).where(URLWebMetadata.url_id.in_(url_ids)).values(status_code=404) await self.execute(query) @@ -1411,7 +1411,7 @@ async def has_pending_urls_not_recently_probed_for_404(self, session: AsyncSessi URLProbedFor404 ).where( and_( - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, or_( URLProbedFor404.id == None, URLProbedFor404.last_probed_at < month_ago @@ -1434,7 +1434,7 @@ async def get_pending_urls_not_recently_probed_for_404(self, session: AsyncSessi URLProbedFor404 ).where( and_( - URL.outcome == URLStatus.PENDING.value, + URL.status == URLStatus.PENDING.value, or_( URLProbedFor404.id == None, URLProbedFor404.last_probed_at < month_ago diff --git a/src/db/client/sync.py b/src/db/client/sync.py index 62e45f08..17483542 100644 --- a/src/db/client/sync.py +++ b/src/db/client/sync.py @@ -119,7 +119,7 @@ def insert_url(self, session, url_info: URLInfo) -> int: url_entry = URL( url=url_info.url, collector_metadata=url_info.collector_metadata, - outcome=url_info.outcome, + status=url_info.status, name=url_info.name, source=url_info.source ) @@ -225,7 +225,7 @@ def mark_urls_as_submitted( update(URL) .where(URL.id == url_id) .values( - outcome=URLStatus.SUBMITTED.value + status=URLStatus.SUBMITTED.value ) ) diff --git a/src/db/models/instantiations/url/core/pydantic/info.py b/src/db/models/instantiations/url/core/pydantic/info.py index d0130c88..f53297c1 100644 --- a/src/db/models/instantiations/url/core/pydantic/info.py +++ b/src/db/models/instantiations/url/core/pydantic/info.py @@ -12,7 +12,7 @@ class URLInfo(BaseModel): batch_id: int | None= None url: str collector_metadata: dict | None = None - outcome: URLStatus = URLStatus.PENDING + status: URLStatus = URLStatus.PENDING updated_at: datetime.datetime | None = None created_at: datetime.datetime | None = None name: str | None = None diff --git a/src/db/models/instantiations/url/core/pydantic/insert.py b/src/db/models/instantiations/url/core/pydantic/insert.py index 438294f6..caac3128 100644 --- a/src/db/models/instantiations/url/core/pydantic/insert.py +++ b/src/db/models/instantiations/url/core/pydantic/insert.py @@ -16,6 +16,6 @@ def sa_model(cls) -> type[Base]: url: str collector_metadata: dict | None = None name: str | None = None - outcome: URLStatus = URLStatus.PENDING + status: URLStatus = URLStatus.PENDING record_type: RecordType | None = None source: URLSource \ No newline at end of file diff --git a/src/db/models/instantiations/url/core/sqlalchemy.py b/src/db/models/instantiations/url/core/sqlalchemy.py index d0af49b1..992187dc 100644 --- a/src/db/models/instantiations/url/core/sqlalchemy.py +++ b/src/db/models/instantiations/url/core/sqlalchemy.py @@ -19,7 +19,7 @@ class URL(UpdatedAtMixin, CreatedAtMixin, WithIDBase): # The metadata from the collector collector_metadata = Column(JSON) # The outcome of the URL: submitted, human_labeling, rejected, duplicate, etc. - outcome = enum_column( + status = enum_column( URLStatus, name='url_status', nullable=False diff --git a/src/db/queries/implementations/core/common/annotation_exists.py b/src/db/queries/implementations/core/common/annotation_exists.py index 41a8fc8d..253d0b57 100644 --- a/src/db/queries/implementations/core/common/annotation_exists.py +++ b/src/db/queries/implementations/core/common/annotation_exists.py @@ -67,6 +67,6 @@ async def build(self) -> Any: *annotation_exists_cases_all ) anno_exists_query = await self._outer_join_models(anno_exists_query) - anno_exists_query = anno_exists_query.where(URL.outcome == URLStatus.PENDING.value) + anno_exists_query = anno_exists_query.where(URL.status == URLStatus.PENDING.value) anno_exists_query = anno_exists_query.group_by(URL.id).cte("annotations_exist") self.query = anno_exists_query diff --git a/src/db/queries/implementations/core/get/recent_batch_summaries/url_counts/builder.py b/src/db/queries/implementations/core/get/recent_batch_summaries/url_counts/builder.py index d1ab774e..f2192307 100644 --- a/src/db/queries/implementations/core/get/recent_batch_summaries/url_counts/builder.py +++ b/src/db/queries/implementations/core/get/recent_batch_summaries/url_counts/builder.py @@ -75,7 +75,7 @@ def apply_pending_urls_filter(self, query: Select): Select(URL).join(LinkBatchURL).where( and_( LinkBatchURL.batch_id == Batch.id, - URL.outcome == URLStatus.PENDING.value + URL.status == URLStatus.PENDING.value ) ) ) @@ -103,7 +103,7 @@ def count_case_url_status( coalesce( count( case( - (URL.outcome == url_status.value, 1) + (URL.status == url_status.value, 1) ) ) , 0).label(label) diff --git a/src/db/queries/implementations/core/metrics/urls/aggregated/pending.py b/src/db/queries/implementations/core/metrics/urls/aggregated/pending.py index 5e27496a..5e6751ca 100644 --- a/src/db/queries/implementations/core/metrics/urls/aggregated/pending.py +++ b/src/db/queries/implementations/core/metrics/urls/aggregated/pending.py @@ -44,7 +44,7 @@ async def build(self) -> Any: URL.id == self.url_id ) .where( - URL.outcome == URLStatus.PENDING.value + URL.status == URLStatus.PENDING.value ).cte("pending") ) diff --git a/src/db/statement_composer.py b/src/db/statement_composer.py index 2e9a69e8..6f00f7ff 100644 --- a/src/db/statement_composer.py +++ b/src/db/statement_composer.py @@ -96,10 +96,10 @@ def exclude_urls_with_agency_suggestions( def pending_urls_missing_miscellaneous_metadata_query() -> Select: query = select(URL).where( and_( - URL.outcome == URLStatus.PENDING.value, - URL.name == None, - URL.description == None, - URLOptionalDataSourceMetadata.url_id == None + URL.status == URLStatus.PENDING.value, + URL.name == None, + URL.description == None, + URLOptionalDataSourceMetadata.url_id == None ) ).outerjoin( URLOptionalDataSourceMetadata diff --git a/tests/automated/integration/api/review/rejection/helpers.py b/tests/automated/integration/api/review/rejection/helpers.py index 2162a7b8..cd6c8c74 100644 --- a/tests/automated/integration/api/review/rejection/helpers.py +++ b/tests/automated/integration/api/review/rejection/helpers.py @@ -36,4 +36,4 @@ async def run_rejection_test( assert len(urls) == 1 url = urls[0] assert url.id == url_mapping.url_id - assert url.outcome == url_status + assert url.status == url_status diff --git a/tests/automated/integration/api/review/test_approve_and_get_next_source.py b/tests/automated/integration/api/review/test_approve_and_get_next_source.py index 780484cc..61ed4add 100644 --- a/tests/automated/integration/api/review/test_approve_and_get_next_source.py +++ b/tests/automated/integration/api/review/test_approve_and_get_next_source.py @@ -50,12 +50,12 @@ async def test_approve_and_get_next_source_for_review(api_test_helper): adb_client = db_data_creator.adb_client # Confirm same agency id is listed as confirmed - urls = await adb_client.get_all(URL) + urls: list[URL] = await adb_client.get_all(URL) assert len(urls) == 1 url = urls[0] assert url.id == url_mapping.url_id assert url.record_type == RecordType.ARREST_RECORDS - assert url.outcome == URLStatus.VALIDATED + assert url.status == URLStatus.VALIDATED assert url.name == "New Test Name" assert url.description == "New Test Description" diff --git a/tests/automated/integration/db/client/approve_url/test_basic.py b/tests/automated/integration/db/client/approve_url/test_basic.py index f438426f..fb7abae9 100644 --- a/tests/automated/integration/db/client/approve_url/test_basic.py +++ b/tests/automated/integration/db/client/approve_url/test_basic.py @@ -42,7 +42,7 @@ async def test_approve_url_basic(db_data_creator: DBDataCreator): url = urls[0] assert url.id == url_mapping.url_id assert url.record_type == RecordType.ARREST_RECORDS - assert url.outcome == URLStatus.VALIDATED + assert url.status == URLStatus.VALIDATED assert url.name == "Test Name" assert url.description == "Test Description" diff --git a/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/data.py b/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/data.py index d7ece710..64a16f9f 100644 --- a/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/data.py +++ b/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/data.py @@ -12,7 +12,7 @@ # Because pending, should not be picked up Entry( input=Input( - outcome=URLStatus.PENDING, + status=URLStatus.PENDING, has_html_content=True, record_type=RecordType.INCARCERATION_RECORDS ), @@ -23,7 +23,7 @@ # Because no html content, should not be picked up Entry( input=Input( - outcome=URLStatus.SUBMITTED, + status=URLStatus.SUBMITTED, has_html_content=False, record_type=RecordType.RECORDS_REQUEST_INFO ), @@ -34,7 +34,7 @@ # Remainder should be picked up Entry( input=Input( - outcome=URLStatus.VALIDATED, + status=URLStatus.VALIDATED, has_html_content=True, record_type=RecordType.RECORDS_REQUEST_INFO ), @@ -46,7 +46,7 @@ ), Entry( input=Input( - outcome=URLStatus.SUBMITTED, + status=URLStatus.SUBMITTED, has_html_content=True, record_type=RecordType.INCARCERATION_RECORDS ), @@ -58,7 +58,7 @@ ), Entry( input=Input( - outcome=URLStatus.NOT_RELEVANT, + status=URLStatus.NOT_RELEVANT, has_html_content=True, record_type=None ), diff --git a/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/models/input.py b/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/models/input.py index cd68782e..b5128375 100644 --- a/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/models/input.py +++ b/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/models/input.py @@ -5,6 +5,6 @@ class TestPushToHuggingFaceURLSetupEntryInput(BaseModel): - outcome: URLStatus + status: URLStatus record_type: RecordType | None has_html_content: bool diff --git a/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/queries/setup.py b/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/queries/setup.py index b8bd2175..e782bd42 100644 --- a/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/queries/setup.py +++ b/tests/automated/integration/tasks/scheduled/impl/huggingface/setup/queries/setup.py @@ -32,7 +32,7 @@ async def run(self, session: AsyncSession) -> list[Record]: inp = entry.input url = URL( url=f"www.testPushToHuggingFaceURLSetupEntry.com/{idx}", - outcome=inp.outcome, + status=inp.status, name=name, description=description, record_type=inp.record_type, diff --git a/tests/automated/integration/tasks/scheduled/impl/sync/data_sources/setup/manager/queries/check.py b/tests/automated/integration/tasks/scheduled/impl/sync/data_sources/setup/manager/queries/check.py index c31748d2..8ed045e8 100644 --- a/tests/automated/integration/tasks/scheduled/impl/sync/data_sources/setup/manager/queries/check.py +++ b/tests/automated/integration/tasks/scheduled/impl/sync/data_sources/setup/manager/queries/check.py @@ -43,4 +43,4 @@ async def check_results(self, url: URL): assert url.name == self.record.final_name agencies = [agency.agency_id for agency in url.confirmed_agencies] assert set(agencies) == set(self.record.final_agency_ids) - assert url.outcome == self.record.final_url_status + assert url.status == self.record.final_url_status diff --git a/tests/automated/integration/tasks/scheduled/impl/sync/data_sources/setup/manager/url.py b/tests/automated/integration/tasks/scheduled/impl/sync/data_sources/setup/manager/url.py index 4c9fdeca..0a5d15b9 100644 --- a/tests/automated/integration/tasks/scheduled/impl/sync/data_sources/setup/manager/url.py +++ b/tests/automated/integration/tasks/scheduled/impl/sync/data_sources/setup/manager/url.py @@ -66,7 +66,7 @@ async def setup_sc_entry( name=entry.name, description=entry.description, collector_metadata={}, - outcome=entry.url_status.value, + status=entry.url_status.value, record_type=entry.record_type.value if entry.record_type is not None else None, source=URLSource.COLLECTOR ) diff --git a/tests/automated/integration/tasks/url/impl/auto_relevant/test_task.py b/tests/automated/integration/tasks/url/impl/auto_relevant/test_task.py index be44c42a..9b7d2274 100644 --- a/tests/automated/integration/tasks/url/impl/auto_relevant/test_task.py +++ b/tests/automated/integration/tasks/url/impl/auto_relevant/test_task.py @@ -31,7 +31,7 @@ async def test_url_auto_relevant_task(db_data_creator): # Get URLs, confirm one is marked as error urls: list[URL] = await adb_client.get_all(URL) assert len(urls) == 3 - counter = Counter([url.outcome for url in urls]) + counter = Counter([url.status for url in urls]) assert counter[URLStatus.ERROR] == 1 assert counter[URLStatus.PENDING] == 2 diff --git a/tests/automated/integration/tasks/url/impl/duplicate/test_url_duplicate_task.py b/tests/automated/integration/tasks/url/impl/duplicate/test_url_duplicate_task.py index e20fd883..ceb4abc1 100644 --- a/tests/automated/integration/tasks/url/impl/duplicate/test_url_duplicate_task.py +++ b/tests/automated/integration/tasks/url/impl/duplicate/test_url_duplicate_task.py @@ -68,7 +68,7 @@ async def test_url_duplicate_task( assert duplicate_url.url_id in url_ids for url in urls: if url.id == duplicate_url.url_id: - assert url.outcome == URLStatus.DUPLICATE + assert url.status == URLStatus.DUPLICATE checked_for_duplicates: list[URLCheckedForDuplicate] = await adb_client.get_all(URLCheckedForDuplicate) assert len(checked_for_duplicates) == 2 diff --git a/tests/automated/integration/tasks/url/impl/html/check/manager.py b/tests/automated/integration/tasks/url/impl/html/check/manager.py index 9b30a4f8..489d7cd8 100644 --- a/tests/automated/integration/tasks/url/impl/html/check/manager.py +++ b/tests/automated/integration/tasks/url/impl/html/check/manager.py @@ -56,7 +56,7 @@ async def _check_has_same_url_status(self): entry = self._id_to_entry[url.id] if entry.expected_result.web_metadata_status_marked_404: continue - assert url.outcome == entry.url_info.status, f"URL {url.url} has outcome {url.outcome} instead of {entry.url_info.status}" + assert url.status == entry.url_info.status, f"URL {url.url} has outcome {url.status} instead of {entry.url_info.status}" async def _check_marked_as_404(self): web_metadata_list: list[URLWebMetadata] = await self.adb_client.get_all( diff --git a/tests/automated/integration/tasks/url/impl/html/setup/manager.py b/tests/automated/integration/tasks/url/impl/html/setup/manager.py index eee71462..718149b9 100644 --- a/tests/automated/integration/tasks/url/impl/html/setup/manager.py +++ b/tests/automated/integration/tasks/url/impl/html/setup/manager.py @@ -30,7 +30,7 @@ async def _setup_urls(self) -> list[TestURLHTMLTaskSetupRecord]: url_insert_models: list[URLInsertModel] = [] for entry in TEST_ENTRIES: url_insert_model = URLInsertModel( - outcome=entry.url_info.status, + status=entry.url_info.status, url=entry.url_info.url, name=f"Test for {entry.url_info.url}", record_type=RecordType.RESOURCES, diff --git a/tests/automated/integration/tasks/url/impl/probe/check/manager.py b/tests/automated/integration/tasks/url/impl/probe/check/manager.py index e8486838..01c835c9 100644 --- a/tests/automated/integration/tasks/url/impl/probe/check/manager.py +++ b/tests/automated/integration/tasks/url/impl/probe/check/manager.py @@ -22,7 +22,7 @@ async def check_url( ): url: URL = await self.adb_client.one_or_none(select(URL).where(URL.id == url_id)) assert url is not None - assert url.outcome == expected_status + assert url.status == expected_status async def check_web_metadata( self, diff --git a/tests/automated/integration/tasks/url/impl/probe/setup/manager.py b/tests/automated/integration/tasks/url/impl/probe/setup/manager.py index fe52e133..746e3ca1 100644 --- a/tests/automated/integration/tasks/url/impl/probe/setup/manager.py +++ b/tests/automated/integration/tasks/url/impl/probe/setup/manager.py @@ -27,7 +27,7 @@ async def setup_url( ) -> int: url_insert_model = URLInsertModel( url=url, - outcome=url_status, + status=url_status, source=TEST_SOURCE ) return ( diff --git a/tests/automated/integration/tasks/url/impl/submit_approved/test_submit_approved_url_task.py b/tests/automated/integration/tasks/url/impl/submit_approved/test_submit_approved_url_task.py index e07e9064..acada2ad 100644 --- a/tests/automated/integration/tasks/url/impl/submit_approved/test_submit_approved_url_task.py +++ b/tests/automated/integration/tasks/url/impl/submit_approved/test_submit_approved_url_task.py @@ -59,9 +59,9 @@ async def test_submit_approved_url_task( url_3 = urls[2] # Check URLs have been marked as 'submitted' - assert url_1.outcome == URLStatus.SUBMITTED - assert url_2.outcome == URLStatus.SUBMITTED - assert url_3.outcome == URLStatus.ERROR + assert url_1.status == URLStatus.SUBMITTED + assert url_2.status == URLStatus.SUBMITTED + assert url_3.status == URLStatus.ERROR # Get URL Data Source Links url_data_sources = await db_data_creator.adb_client.get_all(URLDataSource) diff --git a/tests/automated/integration/tasks/url/impl/test_url_404_probe.py b/tests/automated/integration/tasks/url/impl/test_url_404_probe.py index 0f445486..5c2d4d7e 100644 --- a/tests/automated/integration/tasks/url/impl/test_url_404_probe.py +++ b/tests/automated/integration/tasks/url/impl/test_url_404_probe.py @@ -128,10 +128,10 @@ def find_url(url_id: int) -> URL: return url raise Exception(f"URL with id {url_id} not found") - assert find_url(url_id_success).outcome == URLStatus.PENDING - assert find_url(url_id_404).outcome == URLStatus.NOT_FOUND - assert find_url(url_id_error).outcome == URLStatus.PENDING - assert find_url(url_id_initial_error).outcome == URLStatus.ERROR + assert find_url(url_id_success).status == URLStatus.PENDING + assert find_url(url_id_404).status == URLStatus.NOT_FOUND + assert find_url(url_id_error).status == URLStatus.PENDING + assert find_url(url_id_initial_error).status == URLStatus.ERROR # Check that meets_task_prerequisites now returns False meets_prereqs = await operator.meets_task_prerequisites() diff --git a/tests/helpers/data_creator/commands/impl/urls.py b/tests/helpers/data_creator/commands/impl/urls.py index ab727bef..3e886e34 100644 --- a/tests/helpers/data_creator/commands/impl/urls.py +++ b/tests/helpers/data_creator/commands/impl/urls.py @@ -16,14 +16,14 @@ def __init__( batch_id: int | None, url_count: int, collector_metadata: dict | None = None, - outcome: URLStatus = URLStatus.PENDING, + status: URLStatus = URLStatus.PENDING, created_at: datetime | None = None ): super().__init__() self.batch_id = batch_id self.url_count = url_count self.collector_metadata = collector_metadata - self.outcome = outcome + self.status = status self.created_at = created_at async def run(self) -> InsertURLsInfo: @@ -36,8 +36,8 @@ def run_sync(self) -> InsertURLsInfo: url_infos.append( URLInfo( url=url, - outcome=self.outcome, - name="Test Name" if self.outcome == URLStatus.VALIDATED else None, + status=self.status, + name="Test Name" if self.status == URLStatus.VALIDATED else None, collector_metadata=self.collector_metadata, created_at=self.created_at, source=URLSource.COLLECTOR @@ -50,7 +50,7 @@ def run_sync(self) -> InsertURLsInfo: ) # If outcome is submitted, also add entry to DataSourceURL - if self.outcome == URLStatus.SUBMITTED: + if self.status == URLStatus.SUBMITTED: submitted_url_infos = [] for url_id in url_insert_info.url_ids: submitted_url_info = SubmittedURLInfo( diff --git a/tests/helpers/data_creator/commands/impl/urls_v2/core.py b/tests/helpers/data_creator/commands/impl/urls_v2/core.py index 29d260d6..c80dc447 100644 --- a/tests/helpers/data_creator/commands/impl/urls_v2/core.py +++ b/tests/helpers/data_creator/commands/impl/urls_v2/core.py @@ -33,7 +33,7 @@ async def run(self) -> URLsV2Response: command = URLsDBDataCreatorCommand( batch_id=self.batch_id, url_count=url_parameters.count, - outcome=url_parameters.status, + status=url_parameters.status, created_at=self.created_at ) iui: InsertURLsInfo = self.run_command_sync(command) diff --git a/tests/helpers/data_creator/core.py b/tests/helpers/data_creator/core.py index 2baac69c..d22fc1f9 100644 --- a/tests/helpers/data_creator/core.py +++ b/tests/helpers/data_creator/core.py @@ -246,7 +246,7 @@ def urls( batch_id=batch_id, url_count=url_count, collector_metadata=collector_metadata, - outcome=outcome, + status=outcome, created_at=created_at ) return self.run_command_sync(command) diff --git a/tests/helpers/setup/populate.py b/tests/helpers/setup/populate.py index a6bf5234..6b214bf2 100644 --- a/tests/helpers/setup/populate.py +++ b/tests/helpers/setup/populate.py @@ -12,7 +12,7 @@ async def populate_database(adb_client: AsyncDatabaseClient) -> None: collector_metadata={ "source_collector": "test-data", }, - outcome='validated', + status='validated', record_type="Other" ) await adb_client.add(url) \ No newline at end of file