From d1cbd5005c55fb79fd0678059cffedd382d93b94 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Tue, 19 Nov 2024 18:34:20 +0500 Subject: [PATCH] Rename JobPostingCrawlStrategy.category. --- tests/test_job_posting.py | 10 +++++----- zyte_spider_templates/spiders/job_posting.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_job_posting.py b/tests/test_job_posting.py index 5ba3135..f5b759e 100644 --- a/tests/test_job_posting.py +++ b/tests/test_job_posting.py @@ -269,7 +269,7 @@ def test_metadata(): expected_metadata = { "template": True, "title": "Job posting", - "description": "Template for spiders that extract job posting data from job websites.", + "description": "Template for spiders that extract job posting data from websites.", "param_schema": { "groups": [ { @@ -325,16 +325,16 @@ def test_metadata(): "type": "string", }, "crawl_strategy": { - "default": "category", + "default": "navigation", "description": ( "Determines how input URLs and follow-up URLs are crawled." ), "enumMeta": { - "category": { + "navigation": { "description": ( "Follow pagination and job posting detail pages." ), - "title": "Category", + "title": "Navigation", }, "direct_item": { "description": ( @@ -346,7 +346,7 @@ def test_metadata(): }, "title": "Crawl strategy", "enum": [ - "category", + "navigation", "direct_item", ], "type": "string", diff --git a/zyte_spider_templates/spiders/job_posting.py b/zyte_spider_templates/spiders/job_posting.py index 87b4cd4..0163a29 100644 --- a/zyte_spider_templates/spiders/job_posting.py +++ b/zyte_spider_templates/spiders/job_posting.py @@ -38,7 +38,7 @@ @document_enum class JobPostingCrawlStrategy(str, Enum): - category: str = "category" + navigation: str = "navigation" """Follow pagination and job posting detail pages.""" direct_item: str = "direct_item" @@ -50,11 +50,11 @@ class JobPostingCrawlStrategyParam(BaseModel): crawl_strategy: JobPostingCrawlStrategy = Field( title="Crawl strategy", description="Determines how input URLs and follow-up URLs are crawled.", - default=JobPostingCrawlStrategy.category, + default=JobPostingCrawlStrategy.navigation, json_schema_extra={ "enumMeta": { - JobPostingCrawlStrategy.category: { - "title": "Category", + JobPostingCrawlStrategy.navigation: { + "title": "Navigation", "description": "Follow pagination and job posting detail pages.", }, JobPostingCrawlStrategy.direct_item: { @@ -104,7 +104,7 @@ class JobPostingSpider(Args[JobPostingSpiderParams], BaseSpider): metadata: Dict[str, Any] = { **BaseSpider.metadata, "title": "Job posting", - "description": "Template for spiders that extract job posting data from job websites.", + "description": "Template for spiders that extract job posting data from websites.", } @classmethod