Repository navigation
Fix: preserve explicit configuration in amap_domain - #2560
Open
GoldArowana wants to merge 2 commits into
Open
GoldArowana wants to merge 2 commits into
GoldArowana wants to merge 2 commits into
Conversation
Honor a supplied DomainMapperConfig when amap_domain receives no keyword overrides. Cover public configuration routing and unchanged defaults. Assisted-by: OpenAI Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AsyncWebCrawler.amap_domain(domain, config=...)currently discards an explicitDomainMapperConfigwhen no keyword overrides are passed. For example,source="sitemap",max_urls=3, andinclude_subdomains=Falsebecome the defaults, so discovery can use different sources and limits from those requested.Preserve the supplied config, create defaults only when it is
None, and clone it only when applying keyword overrides. Mapper initialization and scan result/error propagation stay as before.List of files changed and why
crawl4ai/async_webcrawler.py: make the three config paths explicit.tests/test_amap_domain_config.py: cover supplied config before and after mapper initialization, non-mutating overrides, kwargs-only calls, fresh defaults, and errors.How Has This Been Tested?
Exact-source validation run, Python 3.12, source
4c09792296344570909eab2601e6aba98736baf7:2c0b9e9cc6a7918314fe53a63693d1c2c6115f5a: 3 failed, 3 passed, with package import checked inside the test process.python -m pytest tests/test_amap_domain_config.py tests/regression/test_reg_domain_mapper.py -m 'not network' -q: 9 passed, 13 deselected.python -m black --check --diff tests/test_amap_domain_config.pyand compile checks passed. The changed production method follows Black formatting; unrelated existing whole-file formatting differences are left untouched.These tests import the real package and config; the mapper transport is mocked. Browser and live-network discovery tests were not run. Validation used an isolated workflow in the author fork; no workflow changes are included in this PR.
Checklist:
Implementation, test execution, and independent review were assisted by OpenAI Codex. No personal human review or validation is claimed.