Skip to content

Commit

Permalink
Rename JobPostingCrawlStrategy.category.
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Nov 19, 2024
1 parent 2acf2a8 commit d1cbd50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tests/test_job_posting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": (
Expand All @@ -346,7 +346,7 @@ def test_metadata():
},
"title": "Crawl strategy",
"enum": [
"category",
"navigation",
"direct_item",
],
"type": "string",
Expand Down
10 changes: 5 additions & 5 deletions zyte_spider_templates/spiders/job_posting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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: {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d1cbd50

Please sign in to comment.