Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.
Merged
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,4 @@ cython_debug/
#.idea/

openapitools.json
.python-version
9 changes: 4 additions & 5 deletions hatchet_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .clients.dispatcher.dispatcher import DispatcherClient, new_dispatcher
from .clients.events import EventClient, new_event
from .clients.rest_client import RestApi
from .loader import ClientConfig, ConfigLoader
from .loader import ClientConfig


class Client:
Expand All @@ -37,11 +37,10 @@ def from_environment(
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

config: ClientConfig = ConfigLoader(".").load_client_config(defaults)
for opt_function in opts_functions:
opt_function(config)
opt_function(defaults)

return cls.from_config(config, debug)
return cls.from_config(defaults, debug)

@classmethod
def from_config(
Expand Down Expand Up @@ -103,7 +102,7 @@ def __init__(
self.config = config
self.listener = RunEventListenerClient(config)
self.workflow_listener = workflow_listener
self.logInterceptor = config.logInterceptor
self.logInterceptor = config.logger
self.debug = debug


Expand Down
7 changes: 2 additions & 5 deletions hatchet_sdk/hatchet.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from hatchet_sdk.features.cron import CronClient
from hatchet_sdk.features.scheduled import ScheduledClient
from hatchet_sdk.labels import DesiredWorkerLabel
from hatchet_sdk.loader import ClientConfig, ConfigLoader
from hatchet_sdk.loader import ClientConfig
from hatchet_sdk.rate_limit import RateLimit
from hatchet_sdk.v2.callable import HatchetCallable

Expand Down Expand Up @@ -187,11 +187,8 @@ class HatchetRest:
rest (RestApi): Interface for REST API operations.
"""

rest: RestApi

def __init__(self, config: ClientConfig = ClientConfig()):
_config: ClientConfig = ConfigLoader(".").load_client_config(config)
self.rest = RestApi(_config.server_url, _config.token, _config.tenant_id)
self.rest = RestApi(config.server_url, config.token, config.tenant_id)


class Hatchet:
Expand Down
Loading