Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing issues for typed Scrapy. #131

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Fix typing issues for typed Scrapy. #131

wants to merge 4 commits into from

Conversation

wRAR
Copy link
Contributor

@wRAR wRAR commented Sep 21, 2023

No description provided.

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.81%. Comparing base (a2284c8) to head (f0fe7ae).

Current head f0fe7ae differs from pull request most recent head aab7407

Please upload reports for the commit aab7407 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #131      +/-   ##
==========================================
+ Coverage   98.45%   98.81%   +0.35%     
==========================================
  Files          13        9       -4     
  Lines        1102      675     -427     
==========================================
- Hits         1085      667     -418     
+ Misses         17        8       -9     
Files Coverage Δ
scrapy_zyte_api/handler.py 97.95% <100.00%> (-0.31%) ⬇️
scrapy_zyte_api/providers.py 100.00% <100.00%> (+4.22%) ⬆️
scrapy_zyte_api/responses.py 98.95% <100.00%> (-0.05%) ⬇️

... and 10 files with indirect coverage changes

@@ -188,8 +192,8 @@ def _process_response(

if api_response.get("httpResponseHeaders") and api_response.get("httpResponseBody"):
response_cls = responsetypes.from_args(
headers=api_response["httpResponseHeaders"],
url=api_response["url"],
headers=cast(List[Dict[str, str]], api_response["httpResponseHeaders"]),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This produces an error which looks valid: api_response["httpResponseHeaders"] is a list of dicts with "name" and "value" keys while ResponseTypes.from_headers expects a Mapping[bytes, bytes] (not even strings).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We’ll need to address that.

@wRAR wRAR marked this pull request as draft September 26, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants