Skip to content

[Bug]: FilterChain.add_filter incorrect type #1753

@fritz-astronomer

Description

@fritz-astronomer

crawl4ai version

0.8.0

Expected Behavior

You should be able to use add_filter to add a filter.

Current Behavior

class FilterChain:
...
    def __init__(self, filters: List[URLFilter] = None):
        self.filters = tuple(filters or [])  # Immutable tuple for speed
        ...

    def add_filter(self, filter_: URLFilter) -> "FilterChain":
        """Add a filter to the chain"""
        self.filters.append(filter_)
        return self  
E   AttributeError: 'tuple' object has no attribute 'append'

Is this reproducible?

Yes

Steps to Reproduce

FilterChain([...]).add_filter([...])

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 BugSomething isn't working🩺 Needs TriageNeeds attention of maintainers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions