Skip to content
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
8 changes: 1 addition & 7 deletions python/example/client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"""

import asyncio
import os
from typing import Any

from render_sdk.client import Client, ListTaskRunsParams
Expand All @@ -22,13 +21,8 @@

async def main():
"""Demonstrate async workflow operations."""
# Get API token from environment
token = os.getenv("RENDER_API_KEY")
if not token:
print("⚠️ RENDER_API_KEY environment variable not set")
return
# Create client
client = Client(token)
client = Client()

# Example task data - replace with your actual task
task_identifier = "my-workflow-slug/task-name" # Replace with your task identifier
Expand Down
5 changes: 5 additions & 0 deletions python/render_sdk/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ def __init__(
# Set default values
if token is None:
self.token = os.getenv("RENDER_API_KEY", "")
if self.token == "":
raise ValueError(
"Either provide a token or set the RENDER_API_KEY "
+ "environment variable"
)
else:
self.token = token

Expand Down