Skip to content

Commit a08430c

Browse files
committed
Update docs: refine type hints and return types
Adjust various generated API docs to better reflect actual signatures: add explicit return annotations (mostly -> None) for many service methods, generalize kwargs/response types to Any, refine collection element types (e.g. group_users, resolve return), update split_updates return type to return batches of typed dicts, and update an auto-generated WikidataThing sync_time timestamp. These changes improve accuracy and readability of the documentation signatures.
1 parent 7a1b39f commit a08430c

7 files changed

Lines changed: 38 additions & 38 deletions

File tree

docs/knowledge/public/wikidata.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Classes
250250
`repository: str`
251251
: Repository of the search result.
252252

253-
`WikidataThing(revision: str, qid: str, modified: datetime.datetime, label: Dict[str, knowledge.base.entity.Label] | None = None, aliases: Dict[str, List[knowledge.base.entity.Label]] | None = None, description: Dict[str, knowledge.base.entity.Description] | None = None, sync_time: datetime.datetime = datetime.datetime(2026, 2, 6, 21, 58, 0, 771075))`
253+
`WikidataThing(revision: str, qid: str, modified: datetime.datetime, label: Dict[str, knowledge.base.entity.Label] | None = None, aliases: Dict[str, List[knowledge.base.entity.Label]] | None = None, description: Dict[str, knowledge.base.entity.Description] | None = None, sync_time: datetime.datetime = datetime.datetime(2026, 2, 6, 23, 6, 10, 449889))`
254254
: WikidataEntity
255255
-----------
256256
Generic entity within wikidata.

docs/knowledge/services/asyncio/base.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Module knowledge.services.asyncio.base
44
Functions
55
---------
66

7-
`cached_getaddrinfo(host: str, *args, **kwargs) ‑> Any`
7+
`cached_getaddrinfo(host: str, *args: Any, **kwargs: Any) ‑> Any`
88
: Cached address information.
99

1010
Parameters
@@ -94,7 +94,7 @@ Classes
9494
`auth_endpoint: str`
9595
: Authentication endpoint.
9696

97-
`base_auth_url`
97+
`base_auth_url: str`
9898
: Base authentication URL.
9999

100100
`current_session: knowledge.services.session.RefreshableSession | knowledge.services.session.TimedSession | knowledge.services.session.PermanentSession | None`
@@ -110,10 +110,10 @@ Classes
110110
WacomServiceException
111111
Exception if no session is available.
112112

113-
`service_base_url`
113+
`service_base_url: str`
114114
: Service endpoint.
115115

116-
`service_endpoint`
116+
`service_endpoint: str`
117117
: Service endpoint.
118118

119119
`user_agent: str`
@@ -137,7 +137,7 @@ Classes
137137
If the session is already closed, the method will not perform any additional
138138
operations.
139139

140-
`handle_token(self, force_refresh: bool = False, force_refresh_timeout: float = 120) ‑> Tuple[str, str]`
140+
`handle_token(self, force_refresh: bool = False, force_refresh_timeout: float = 120) ‑> Tuple[str, str | None]`
141141
: Handles the token and refreshes it if needed.
142142
143143
Parameters
@@ -167,7 +167,7 @@ Classes
167167
Session. The session is stored in the token manager, and the client is using the session id for further
168168
calls.
169169

170-
`logout(self)`
170+
`logout(self) ‑> None`
171171
: Logs out the user from the current session.
172172
173173
This method handles the removal of the current session from the token manager
@@ -239,7 +239,7 @@ Classes
239239
WacomServiceException
240240
Exception if the service returns HTTP error code.
241241

242-
`use_session(self, session_id: str)`
242+
`use_session(self, session_id: str) ‑> None`
243243
: Use session.
244244
Parameters
245245
----------
@@ -280,7 +280,7 @@ Classes
280280
Exception
281281
If an error occurs during the session closure operation.
282282

283-
`delete(self, url: str, **kwargs) ‑> knowledge.services.asyncio.base.ResponseData`
283+
`delete(self, url: str, **kwargs: Any) ‑> knowledge.services.asyncio.base.ResponseData`
284284
: Asynchronously performs an HTTP DELETE request.
285285
286286
This method sends a DELETE request to the specified URL with additional
@@ -301,7 +301,7 @@ Classes
301301
The response object resulting from the DELETE request. This
302302
provides access to the response data, status, and headers.
303303

304-
`get(self, url: str, **kwargs) ‑> knowledge.services.asyncio.base.ResponseData`
304+
`get(self, url: str, **kwargs: Any) ‑> knowledge.services.asyncio.base.ResponseData`
305305
: Asynchronously sends an HTTP GET request to the specified URL.
306306
307307
This method allows sending GET requests with optional additional parameters
@@ -322,7 +322,7 @@ Classes
322322
The response object resulting from the get-go request, containing status,
323323
headers, and body data.
324324

325-
`patch(self, url: str, **kwargs) ‑> knowledge.services.asyncio.base.ResponseData`
325+
`patch(self, url: str, **kwargs: Any) ‑> knowledge.services.asyncio.base.ResponseData`
326326
: Asynchronously sends a HTTP PATCH request to the specified URL.
327327
328328
This method is a coroutine that simplifies sending PATCH requests
@@ -345,7 +345,7 @@ Classes
345345
methods for accessing the content, status, and headers of the HTTP
346346
response.
347347

348-
`post(self, url: str, **kwargs) ‑> knowledge.services.asyncio.base.ResponseData`
348+
`post(self, url: str, **kwargs: Any) ‑> knowledge.services.asyncio.base.ResponseData`
349349
: Sends an asynchronous HTTP POST request to the specified URL with the given parameters.
350350
351351
This method uses the underlying `request` method to perform the HTTP POST
@@ -367,7 +367,7 @@ Classes
367367
ResponseData
368368
Represents the response object from the POST request.
369369

370-
`put(self, url: str, **kwargs) ‑> knowledge.services.asyncio.base.ResponseData`
370+
`put(self, url: str, **kwargs: Any) ‑> knowledge.services.asyncio.base.ResponseData`
371371
: Asynchronously performs an HTTP PUT request.
372372
373373
The method sends an HTTP PUT request to the specified URL with the given
@@ -385,7 +385,7 @@ Classes
385385
ResponseData
386386
The response object returned after the PUT request is completed.
387387

388-
`request(self, method: Literal['GET', 'POST', 'PUT', 'DELETE', 'PATCH'], url: str, headers: Dict[str, str] | None = None, **kwargs) ‑> knowledge.services.asyncio.base.ResponseData`
388+
`request(self, method: Literal['GET', 'POST', 'PUT', 'DELETE', 'PATCH'], url: str, headers: Dict[str, str] | None = None, **kwargs: Any) ‑> knowledge.services.asyncio.base.ResponseData`
389389
: Executes an HTTP request using the specified method, URL, headers, and additional options.
390390
391391
Parameters
@@ -424,7 +424,7 @@ Classes
424424
`close(self) ‑> None`
425425
: Release resolver
426426

427-
`resolve(self, host: str, port: int = 0, family: int = 2)`
427+
`resolve(self, host: str, port: int = 0, family: int = 2) ‑> List[Dict[str, Any]]`
428428
: Resolves a hostname to a list of address information. This is an asynchronous
429429
method that fetches the address details for the given hostname. The result
430430
includes protocol, host address, port, and family information. The family

docs/knowledge/services/asyncio/graph.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Classes
114114
WacomServiceException
115115
If the graph service returns an error code, and activation failed.
116116

117-
`add_entity_indexes(self, entity_uri: str, targets: List[Literal['NEL', 'ElasticSearch', 'VectorSearchWord', 'VectorSearchDocument']], auth_key: str | None = None, timeout: int = 60) ‑> Dict[Literal['NEL', 'ElasticSearch', 'VectorSearchWord', 'VectorSearchDocument'], Any]`
117+
`add_entity_indexes(self, entity_uri: str, targets: List[Literal['NEL', 'ElasticSearch', 'VectorSearchWord', 'VectorSearchDocument']], auth_key: str | None = None, timeout: int = 60) ‑> Dict[str, Any]`
118118
: Updates index targets of an entity. The index targets can be set to "NEL", "ElasticSearch", "VectorSearchWord",
119119
or "VectorSearchDocument".
120120
If the target is already set for the entity, there will be no changes.
@@ -188,7 +188,7 @@ Classes
188188
WacomServiceException
189189
If the graph service returns an error code
190190

191-
`create_relation(self, source: str, relation: knowledge.base.ontology.OntologyPropertyReference, target: str, auth_key: str | None = None)`
191+
`create_relation(self, source: str, relation: knowledge.base.ontology.OntologyPropertyReference, target: str, auth_key: str | None = None) ‑> None`
192192
: Creates a relation for an entity to a source entity.
193193
194194
Parameters
@@ -207,7 +207,7 @@ Classes
207207
WacomServiceException
208208
If the graph service returns an error code
209209

210-
`create_relations_bulk(self, source: str, relations: Dict[knowledge.base.ontology.OntologyPropertyReference, List[str]], auth_key: str | None = None, timeout: int = 60)`
210+
`create_relations_bulk(self, source: str, relations: Dict[knowledge.base.ontology.OntologyPropertyReference, List[str]], auth_key: str | None = None, timeout: int = 60) ‑> None`
211211
: Creates all the relations for an entity to a source entity.
212212
213213
Parameters
@@ -229,7 +229,7 @@ Classes
229229
WacomServiceException
230230
If the graph service returns an error code
231231

232-
`delete_entities(self, uris: List[str], force: bool = False, auth_key: str | None = None)`
232+
`delete_entities(self, uris: List[str], force: bool = False, auth_key: str | None = None) ‑> None`
233233
: Delete a list of entities.
234234
235235
Parameters
@@ -248,7 +248,7 @@ Classes
248248
ValueError
249249
If more than 100 entities are given
250250

251-
`delete_entity(self, uri: str, force: bool = False, auth_key: str | None = None)`
251+
`delete_entity(self, uri: str, force: bool = False, auth_key: str | None = None) ‑> None`
252252
: Deletes an entity.
253253
254254
Parameters
@@ -533,7 +533,7 @@ Classes
533533
WacomServiceException
534534
If the graph service returns an error code
535535

536-
`ontology_update(self, fix: bool = False, auth_key: str | None = None)`
536+
`ontology_update(self, fix: bool = False, auth_key: str | None = None) ‑> None`
537537
: Update the ontology.
538538
539539
**Remark: **
@@ -575,7 +575,7 @@ Classes
575575
WacomServiceException
576576
If the graph service returns an error code
577577

578-
`remove_entity_indexes(self, entity_uri: str, targets: List[Literal['NEL', 'ElasticSearch', 'VectorSearchWord', 'VectorSearchDocument']], auth_key: str | None = None, timeout: int = 60) ‑> Dict[Literal['NEL', 'ElasticSearch', 'VectorSearchWord', 'VectorSearchDocument'], Any]`
578+
`remove_entity_indexes(self, entity_uri: str, targets: List[Literal['NEL', 'ElasticSearch', 'VectorSearchWord', 'VectorSearchDocument']], auth_key: str | None = None, timeout: int = 60) ‑> Dict[str, Any]`
579579
: Deletes the search index for a given entity.
580580
581581
Parameters
@@ -850,7 +850,7 @@ Classes
850850
WacomServiceException
851851
If the graph service returns an error code.
852852

853-
`update_entity(self, entity: knowledge.base.ontology.ThingObject, auth_key: str | None = None, timeout: int = 60)`
853+
`update_entity(self, entity: knowledge.base.ontology.ThingObject, auth_key: str | None = None, timeout: int = 60) ‑> None`
854854
: Updates entity in the graph.
855855
856856
Parameters

docs/knowledge/services/asyncio/users.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Classes
6464
WacomServiceException
6565
If the tenant service returns an error code.
6666

67-
`delete_user(self, tenant_key: str, external_id: str, internal_id: str, force: bool = False, timeout: int = 60)`
67+
`delete_user(self, tenant_key: str, external_id: str, internal_id: str, force: bool = False, timeout: int = 60) ‑> None`
6868
: Deletes user from tenant.
6969
7070
Parameters
@@ -104,7 +104,7 @@ Classes
104104
user: List[User]
105105
List of users.
106106

107-
`update_user(self, tenant_key: str, internal_id: str, external_id: str, meta_data: Dict[str, str] | None = None, roles: List[knowledge.services.users.UserRole] = None, timeout: int = 60)`
107+
`update_user(self, tenant_key: str, internal_id: str, external_id: str, meta_data: Dict[str, str] | None = None, roles: List[knowledge.services.users.UserRole] | None = None, timeout: int = 60) ‑> None`
108108
: Updates user for a tenant.
109109
110110
Parameters

docs/knowledge/services/group.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Classes
108108

109109
### Instance variables
110110

111-
`group_users: List`
111+
`group_users: List[knowledge.services.users.User]`
112112
: List of all users that are part of the group.
113113

114114
`GroupManagementService(service_url: str, application_name: str = 'Group Management Service', service_endpoint: str = 'graph/v1')`
@@ -142,7 +142,7 @@ Classes
142142

143143
### Methods
144144

145-
`add_entity_to_group(self, group_id: str, entity_uri: str, auth_key: str | None = None, timeout: int = 60)`
145+
`add_entity_to_group(self, group_id: str, entity_uri: str, auth_key: str | None = None, timeout: int = 60) ‑> None`
146146
: Adding an entity to a group.
147147
148148
Parameters
@@ -160,7 +160,7 @@ Classes
160160
WacomServiceException
161161
If the tenant service returns an error code.
162162

163-
`add_user_to_group(self, group_id: str, user_id: str, auth_key: str | None = None, timeout: int = 60)`
163+
`add_user_to_group(self, group_id: str, user_id: str, auth_key: str | None = None, timeout: int = 60) ‑> None`
164164
: Adding a user to a group.
165165
166166
Parameters
@@ -201,7 +201,7 @@ Classes
201201
WacomServiceException
202202
If the tenant service returns an error code.
203203

204-
`delete_group(self, group_id: str, force: bool = False, auth_key: str | None = None, timeout: int = 60)`
204+
`delete_group(self, group_id: str, force: bool = False, auth_key: str | None = None, timeout: int = 60) ‑> None`
205205
: Delete a group.
206206
207207
Parameters
@@ -241,7 +241,7 @@ Classes
241241
WacomServiceException
242242
If the tenant service returns an error code.
243243

244-
`join_group(self, group_id: str, join_key: str, auth_key: str | None = None, timeout: int = 60)`
244+
`join_group(self, group_id: str, join_key: str, auth_key: str | None = None, timeout: int = 60) ‑> None`
245245
: User joining a group with his auth token.
246246
247247
Parameters
@@ -259,7 +259,7 @@ Classes
259259
WacomServiceException
260260
If the tenant service returns an error code.
261261

262-
`leave_group(self, group_id: str, auth_key: str | None = None, timeout: int = 60)`
262+
`leave_group(self, group_id: str, auth_key: str | None = None, timeout: int = 60) ‑> None`
263263
: User leaving a group with his auth token.
264264
265265
Parameters
@@ -296,7 +296,7 @@ Classes
296296
user: List[Groups]
297297
List of groups.
298298

299-
`remove_entity_to_group(self, group_id: str, entity_uri: str, auth_key: str | None = None, timeout: int = 60)`
299+
`remove_entity_to_group(self, group_id: str, entity_uri: str, auth_key: str | None = None, timeout: int = 60) ‑> None`
300300
: Remove an entity from group.
301301
302302
Parameters
@@ -314,7 +314,7 @@ Classes
314314
WacomServiceException
315315
If the tenant service returns an error code.
316316

317-
`remove_user_from_group(self, group_id: str, user_id: str, force: bool = False, auth_key: str | None = None, timeout: int = 60)`
317+
`remove_user_from_group(self, group_id: str, user_id: str, force: bool = False, auth_key: str | None = None, timeout: int = 60) ‑> None`
318318
: Remove a user from a group.
319319
320320
Parameters
@@ -335,7 +335,7 @@ Classes
335335
WacomServiceException
336336
If the tenant service returns an error code.
337337

338-
`update_group(self, group_id: str, name: str, rights: knowledge.base.access.GroupAccessRight = knowledge.base.access.GroupAccessRight, auth_key: str | None = None, timeout: int = 60)`
338+
`update_group(self, group_id: str, name: str, rights: knowledge.base.access.GroupAccessRight = [Read], auth_key: str | None = None, timeout: int = 60) ‑> None`
339339
: Updates a group.
340340
341341
Parameters

docs/knowledge/services/helper.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Functions
2222
Dict[str, Any]
2323
The payload for the entity.
2424

25-
`split_updates(updates: Dict[knowledge.base.ontology.OntologyPropertyReference, List[str]], max_operations: int = 30) ‑> Iterator[Dict[str, List[str]]]`
25+
`split_updates(updates: Dict[knowledge.base.ontology.OntologyPropertyReference, List[str]], max_operations: int = 30) ‑> Iterator[List[Dict[str, str | List[str]]]]`
2626
: Parameters
2727
----------
2828
updates: Dict[OntologyPropertyReference, List[str]]
@@ -32,5 +32,5 @@ Functions
3232

3333
Yields
3434
-------
35-
batch: List[Dict[str, List[str]]]
35+
batch: List[Dict[str, Union[str, List[str]]]]
3636
The batch of updates to process.

docs/knowledge/services/tenant.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Classes
8888
WacomServiceException
8989
If the tenant service returns an error code.
9090

91-
`delete_tenant(self, identifier: str, timeout: int = 60)`
91+
`delete_tenant(self, identifier: str, timeout: int = 60) ‑> None`
9292
: Delete a tenant.
9393
Parameters
9494
----------
@@ -120,7 +120,7 @@ Classes
120120
WacomServiceException
121121
If the tenant service returns an error code.
122122

123-
`update_tenant_configuration(self, identifier: str, rights: List[str], vector_search_data_properties: List[str], vector_search_object_properties: List[str], content_data_property_name: str, timeout: int = 60)`
123+
`update_tenant_configuration(self, identifier: str, rights: List[str], vector_search_data_properties: List[str], vector_search_object_properties: List[str], content_data_property_name: str, timeout: int = 60) ‑> None`
124124
: Update the configuration of a tenant.
125125
126126
Parameters

0 commit comments

Comments
 (0)