Skip to content

Commit

Permalink
remove duplicate task
Browse files Browse the repository at this point in the history
  • Loading branch information
m-p-esser committed Oct 8, 2023
1 parent 72f7689 commit adff839
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/prefect/generic_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,37 +155,6 @@ async def request_unsplash_api_async(
return response


@task(
# cache_key_fn=task_input_hash,
# cache_expiration=datetime.timedelta(hours=1),
timeout_seconds=20,
)
async def request_unsplash_images_async(
endpoint: str,
proxies: dict = None,
headers: dict = None,
params: dict = None,
base_url="https://images.unsplash.com",
**kwargs,
):
logger = get_run_logger()

async with httpx.AsyncClient(proxies=proxies, verify=False) as client:
URI = base_url + endpoint

logger.info(f"Requesting URI: {URI}")
response = await client.get(url=URI, params=params, headers=headers)

response.raise_for_status()

if len(kwargs) > 0:
kwargs["response"] = response
return kwargs

else:
return response


@task(
# cache_key_fn=task_input_hash,
# cache_expiration=datetime.timedelta(hours=1),
Expand Down

0 comments on commit adff839

Please sign in to comment.