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

chore(blocks/fal): Use dict instead of Dict #8855

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(
):
self.redis = Redis(
host=redis_host,
port=redis_port,
port=int(redis_port),
password=redis_password,
decode_responses=True,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import time
from enum import Enum
from typing import Any, Dict
from typing import Any

import httpx

Expand Down Expand Up @@ -64,16 +64,16 @@ def __init__(self):
},
)

def _get_headers(self, api_key: str) -> Dict[str, str]:
def _get_headers(self, api_key: str) -> dict[str, str]:
"""Get headers for FAL API requests."""
return {
"Authorization": f"Key {api_key}",
"Content-Type": "application/json",
}

def _submit_request(
self, url: str, headers: Dict[str, str], data: Dict[str, Any]
) -> Dict[str, Any]:
self, url: str, headers: dict[str, str], data: dict[str, Any]
) -> dict[str, Any]:
"""Submit a request to the FAL API."""
try:
response = httpx.post(url, headers=headers, json=data)
Expand All @@ -83,7 +83,7 @@ def _submit_request(
logger.error(f"FAL API request failed: {str(e)}")
raise RuntimeError(f"Failed to submit request: {str(e)}")

def _poll_status(self, status_url: str, headers: Dict[str, str]) -> Dict[str, Any]:
def _poll_status(self, status_url: str, headers: dict[str, str]) -> dict[str, Any]:
"""Poll the status endpoint until completion or failure."""
try:
response = httpx.get(status_url, headers=headers)
Expand Down
Loading