crawl4ai icon indicating copy to clipboard operation
crawl4ai copied to clipboard

fix: pass user_query to parent class in PruningContentFilter

Open jnMetaCode opened this issue 8 months ago • 0 comments

Summary

PruningContentFilter.__init__() accepts a user_query parameter but passes None to the parent RelevantContentFilter.__init__() instead of forwarding it:

super().__init__(None)  # user_query is silently dropped

This means self.user_query is always None in PruningContentFilter, even when the caller explicitly provides a query. Any downstream logic that relies on self.user_query (inherited from RelevantContentFilter) will not work as expected.

Changes

  • content_filter_strategy.py line 574: super().__init__(None) → super().__init__(user_query=user_query)

Impact

Users passing user_query to PruningContentFilter would expect query-aware filtering, but the query was silently discarded. This fix ensures the parameter is properly forwarded to the base class.

jnMetaCode avatar Mar 08 '26 04:03 jnMetaCode