Skip to content

Commit b64f3e7

Browse files
committed
update docstrings
1 parent 6b8126d commit b64f3e7

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

src/posit/connect/jobs.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
from typing_extensions import NotRequired, Required, Unpack
44

5-
from posit.connect.context import Context
6-
5+
from .context import Context
76
from .resources import Active, ActiveFinderMethods, ActiveSequence, Resource
87

98
JobTag = Literal[
@@ -102,29 +101,33 @@ class _Job(TypedDict):
102101
"""A tag categorizing the job type. Options are build_jupyter, build_report, build_site, configure_report, git, packrat_restore, python_restore, render_shiny, run_api, run_app, run_bokeh_app, run_dash_app, run_fastapi_app, run_pyshiny_app, run_python_api, run_streamlit, run_tensorflow, run_voila_app, testing, unknown, val_py_ext_pkg, val_r_ext_pkg, and val_r_install."""
103102

104103
@overload
105-
def __init__(self, ctx: Context, base: str, uid: str, /, **kwargs: Unpack[_Job]):
104+
def __init__(self, ctx: Context, base: str, uid: str, /, **attributes: Unpack[_Job]):
105+
...
106+
107+
@overload
108+
def __init__(self, ctx: Context, base: str, uid: str, /, **attributes: Any): ...
109+
110+
def __init__(self, ctx: Context, base: str, uid: str, /, **attributes: Any):
106111
"""A Job.
107112
108113
A Job represents single execution instance of Content on Connect. Whenever Content runs, whether it's a scheduled report, a script execution, or server processes related to an application, a Job is created to manage and encapsulate that execution.
109114
110115
Parameters
111116
----------
112117
ctx : Context
113-
The context object that holds the HTTP session used for sending the GET request.
114-
parent : ContentItem
115-
The Content related to this Job.
118+
The context object containing the session and URL for API interactions.
119+
base : str
120+
The base HTTP path for the Job endpoint (e.g., '/jobs')
121+
uid : str
122+
The unique identifier
123+
**attributes
124+
Object items passed to the base resource dictionary.
116125
117126
Notes
118127
-----
119-
A Job is a reference to a server process on Connect, it is not the process itself. Jobs are executed asynchronously
128+
A Job is a reference to a server process on Connect, it is not the process itself. Jobs are executed asynchronously.
120129
"""
121-
...
122-
123-
@overload
124-
def __init__(self, ctx: Context, base: str, uid: str, /, **kwargs: Any): ...
125-
126-
def __init__(self, ctx: Context, base: str, uid: str, /, **kwargs: Any):
127-
super().__init__(ctx, **kwargs)
130+
super().__init__(ctx, **attributes)
128131
self._endpoint = ctx.url + base + uid
129132

130133
def destroy(self) -> None:

0 commit comments

Comments
 (0)