Closed chrisfandrade16 closed 1 month ago
So instead, in Buckets and Results there should be a validator which reads DEFAULT_WORKSPACE_PATH and gets the baseurl from there.
This is already done by the HTTPContext
, the idea is to use it instead of individual clients, by default the HTTPContext
initializes all the clients but you can specify the backends you want the context to use like:
In [1]: from workflow.http.context import HTTPContext
In [2]: http = HTTPContext(backends=["buckets", "results"])
In [3]: http.pipelines # None
In [4]: http.buckets # Was initialized on backends
Out[4]: Buckets(baseurl='http://localhost:8004', timeout=15.0, token=None, session=<requests.sessions.Session object at 0x0000028F5B23D540>)
Yeah, I gotcha. I think it's just an unfortunate breaking change. I suppose if you want to initialize Buckets
(or whatever service directly), you'd have to just give the baseurl
. I will close this.
I should be able to do something like this:
But this throws an error:
Because
Buckets
andResults
inheritClient
which has:That's fine,
baseurl
should be required, and you can't really specify a default here sinceClient
is general for any Workflow service. So instead, inBuckets
andResults
there should be a validator which readsDEFAULT_WORKSPACE_PATH
and gets thebaseurl
from there.Or do we want to discouage the use of Buckets and Results directly in favour of HTTPContext?