mirror of
https://github.com/vinta/awesome-python.git
synced 2026-10-20 18:52:21 +00:00
refactor(fetch_github_stars): drop unnecessary keyword-only marker on fetch_batch
client is the only non-first param and is always required, so the * separator adds no clarity. Update the call site accordingly. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a358d45ca4
commit
b9236c4925
1 changed files with 2 additions and 4 deletions
|
|
@ -80,9 +80,7 @@ def parse_graphql_response(
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def fetch_batch(
|
def fetch_batch(repos: list[str], client: httpx.Client) -> dict[str, dict]:
|
||||||
repos: list[str], *, client: httpx.Client,
|
|
||||||
) -> dict[str, dict]:
|
|
||||||
"""Fetch star data for a batch of repos via GitHub GraphQL API."""
|
"""Fetch star data for a batch of repos via GitHub GraphQL API."""
|
||||||
query = build_graphql_query(repos)
|
query = build_graphql_query(repos)
|
||||||
if not query:
|
if not query:
|
||||||
|
|
@ -154,7 +152,7 @@ def main() -> None:
|
||||||
print(f"Fetching batch {batch_num}/{total_batches} ({len(batch)} repos)...")
|
print(f"Fetching batch {batch_num}/{total_batches} ({len(batch)} repos)...")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
results = fetch_batch(batch, client=client)
|
results = fetch_batch(batch, client)
|
||||||
except httpx.HTTPStatusError as e:
|
except httpx.HTTPStatusError as e:
|
||||||
print(f"HTTP error {e.response.status_code}", file=sys.stderr)
|
print(f"HTTP error {e.response.status_code}", file=sys.stderr)
|
||||||
if e.response.status_code == 401:
|
if e.response.status_code == 401:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue