Skip to content

Commit 23e9f36

Browse files
tpellissierclaude
andcommitted
Use :class: role in :type:/:rtype: directives for Sphinx cross-references
Aligns with existing codebase convention and ensures clickable hyperlinks in generated API documentation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1cfdac0 commit 23e9f36

3 files changed

Lines changed: 39 additions & 39 deletions

File tree

src/PowerPlatform/Dataverse/operations/query.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,32 @@ def get(
6161
6262
:param table: Schema name of the table (e.g. ``"account"`` or
6363
``"new_MyTestTable"``).
64-
:type table: str
64+
:type table: :class:`str`
6565
:param select: Optional list of column logical names to include.
6666
Column names are automatically lowercased.
67-
:type select: list[str] | None
67+
:type select: :class:`list` of :class:`str` or None
6868
:param filter: Optional OData ``$filter`` expression (e.g.
6969
``"name eq 'Contoso'"``). Column names in filter expressions must
7070
use exact lowercase logical names. Passed directly without
7171
transformation.
72-
:type filter: str | None
72+
:type filter: :class:`str` or None
7373
:param orderby: Optional list of sort expressions (e.g.
7474
``["name asc", "createdon desc"]``). Column names are automatically
7575
lowercased.
76-
:type orderby: list[str] | None
76+
:type orderby: :class:`list` of :class:`str` or None
7777
:param top: Optional maximum total number of records to return.
78-
:type top: int | None
78+
:type top: :class:`int` or None
7979
:param expand: Optional list of navigation properties to expand (e.g.
8080
``["primarycontactid"]``). Case-sensitive; must match server-defined
8181
names exactly.
82-
:type expand: list[str] | None
82+
:type expand: :class:`list` of :class:`str` or None
8383
:param page_size: Optional per-page size hint sent via
8484
``Prefer: odata.maxpagesize``.
85-
:type page_size: int | None
85+
:type page_size: :class:`int` or None
8686
8787
:return: Generator yielding pages, where each page is a list of record
8888
dictionaries.
89-
:rtype: Iterable[list[dict[str, Any]]]
89+
:rtype: :class:`collections.abc.Iterable` of :class:`list` of :class:`dict`
9090
9191
Example:
9292
Query with filtering and pagination::
@@ -134,11 +134,11 @@ def sql(self, sql: str) -> List[Dict[str, Any]]:
134134
names only), and a simple table alias after FROM.
135135
136136
:param sql: Supported SQL SELECT statement.
137-
:type sql: str
137+
:type sql: :class:`str`
138138
139139
:return: List of result row dictionaries. Returns an empty list when no
140140
rows match.
141-
:rtype: list[dict[str, Any]]
141+
:rtype: :class:`list` of :class:`dict`
142142
143143
:raises ~PowerPlatform.Dataverse.core.errors.ValidationError:
144144
If ``sql`` is not a string or is empty.

src/PowerPlatform/Dataverse/operations/records.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ def create(
6363
records via the ``CreateMultiple`` action and returns a list of GUIDs.
6464
6565
:param table: Schema name of the table (e.g. ``"account"`` or ``"new_MyTestTable"``).
66-
:type table: str
66+
:type table: :class:`str`
6767
:param data: A single record dictionary or a list of record dictionaries.
6868
Each dictionary maps column schema names to values.
69-
:type data: dict[str, Any] | list[dict[str, Any]]
69+
:type data: :class:`dict` or :class:`list` of :class:`dict`
7070
7171
:return: A single GUID string for a single record, or a list of GUID
7272
strings for bulk creation.
73-
:rtype: str | list[str]
73+
:rtype: :class:`str` or :class:`list` of :class:`str`
7474
7575
:raises TypeError: If ``data`` is not a dict or list[dict].
7676
@@ -122,12 +122,12 @@ def update(
122122
equal length).
123123
124124
:param table: Schema name of the table (e.g. ``"account"``).
125-
:type table: str
125+
:type table: :class:`str`
126126
:param ids: A single GUID string, or a list of GUID strings.
127-
:type ids: str | list[str]
127+
:type ids: :class:`str` or :class:`list` of :class:`str`
128128
:param changes: A dictionary of field changes (single/broadcast), or a
129129
list of dictionaries (paired, one per ID).
130-
:type changes: dict[str, Any] | list[dict[str, Any]]
130+
:type changes: :class:`dict` or :class:`list` of :class:`dict`
131131
132132
:raises TypeError: If ``ids`` is not str or list[str], or if ``changes``
133133
does not match the expected pattern.
@@ -182,16 +182,16 @@ def delete(
182182
ID) or deletes each record sequentially depending on ``use_bulk_delete``.
183183
184184
:param table: Schema name of the table (e.g. ``"account"``).
185-
:type table: str
185+
:type table: :class:`str`
186186
:param ids: A single GUID string, or a list of GUID strings.
187-
:type ids: str | list[str]
187+
:type ids: :class:`str` or :class:`list` of :class:`str`
188188
:param use_bulk_delete: When True (default) and ``ids`` is a list, use
189189
the BulkDelete action and return its async job ID. When False, delete
190190
records one at a time.
191-
:type use_bulk_delete: bool
191+
:type use_bulk_delete: :class:`bool`
192192
193193
:return: The BulkDelete job ID when bulk-deleting; otherwise None.
194-
:rtype: str | None
194+
:rtype: :class:`str` or None
195195
196196
:raises TypeError: If ``ids`` is not str or list[str].
197197
@@ -232,15 +232,15 @@ def get(
232232
"""Fetch a single record by its GUID.
233233
234234
:param table: Schema name of the table (e.g. ``"account"``).
235-
:type table: str
235+
:type table: :class:`str`
236236
:param record_id: GUID of the record to retrieve.
237-
:type record_id: str
237+
:type record_id: :class:`str`
238238
:param select: Optional list of column logical names to include in the
239239
response.
240-
:type select: list[str] | None
240+
:type select: :class:`list` of :class:`str` or None
241241
242242
:return: Record dictionary with the requested attributes.
243-
:rtype: dict[str, Any]
243+
:rtype: :class:`dict`
244244
245245
:raises TypeError: If ``record_id`` is not a string.
246246

src/PowerPlatform/Dataverse/operations/tables.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,27 @@ def create(
6767
6868
:param table: Schema name of the table with customization prefix
6969
(e.g. ``"new_MyTestTable"``).
70-
:type table: str
70+
:type table: :class:`str`
7171
:param columns: Mapping of column schema names (with customization
7272
prefix) to their types. Supported types include ``"string"``
7373
(or ``"text"``), ``"int"`` (or ``"integer"``), ``"decimal"``
7474
(or ``"money"``), ``"float"`` (or ``"double"``), ``"datetime"``
7575
(or ``"date"``), ``"bool"`` (or ``"boolean"``), ``"file"``, and
7676
``Enum`` subclasses
7777
(for local option sets).
78-
:type columns: dict[str, Any]
78+
:type columns: :class:`dict`
7979
:param solution: Optional solution unique name that should own the new
8080
table. When omitted the table is created in the default solution.
81-
:type solution: str | None
81+
:type solution: :class:`str` or None
8282
:param primary_column: Optional primary name column schema name with
8383
customization prefix (e.g. ``"new_ProductName"``). If not provided,
8484
defaults to ``"{prefix}_Name"``.
85-
:type primary_column: str | None
85+
:type primary_column: :class:`str` or None
8686
8787
:return: Dictionary containing table metadata including
8888
``table_schema_name``, ``entity_set_name``, ``table_logical_name``,
8989
``metadata_id``, and ``columns_created``.
90-
:rtype: dict[str, Any]
90+
:rtype: :class:`dict`
9191
9292
:raises ~PowerPlatform.Dataverse.core.errors.MetadataError:
9393
If table creation fails or the table already exists.
@@ -127,7 +127,7 @@ def delete(self, table: str) -> None:
127127
"""Delete a custom table by schema name.
128128
129129
:param table: Schema name of the table (e.g. ``"new_MyTestTable"``).
130-
:type table: str
130+
:type table: :class:`str`
131131
132132
:raises ~PowerPlatform.Dataverse.core.errors.MetadataError:
133133
If the table does not exist or deletion fails.
@@ -150,12 +150,12 @@ def get(self, table: str) -> Optional[Dict[str, Any]]:
150150
151151
:param table: Schema name of the table (e.g. ``"new_MyTestTable"``
152152
or ``"account"``).
153-
:type table: str
153+
:type table: :class:`str`
154154
155155
:return: Dictionary containing ``table_schema_name``,
156156
``table_logical_name``, ``entity_set_name``, and ``metadata_id``.
157157
Returns None if the table is not found.
158-
:rtype: dict[str, Any] | None
158+
:rtype: :class:`dict` or None
159159
160160
Example::
161161
@@ -173,7 +173,7 @@ def list(self) -> List[Dict[str, Any]]:
173173
"""List all non-private tables in the Dataverse environment.
174174
175175
:return: List of EntityDefinition metadata dictionaries.
176-
:rtype: list[dict[str, Any]]
176+
:rtype: :class:`list` of :class:`dict`
177177
178178
Example::
179179
@@ -194,14 +194,14 @@ def add_columns(
194194
"""Add one or more columns to an existing table.
195195
196196
:param table: Schema name of the table (e.g. ``"new_MyTestTable"``).
197-
:type table: str
197+
:type table: :class:`str`
198198
:param columns: Mapping of column schema names (with customization
199199
prefix) to their types. Supported types are the same as for
200200
:meth:`create`.
201-
:type columns: dict[str, Any]
201+
:type columns: :class:`dict`
202202
203203
:return: Schema names of the columns that were created.
204-
:rtype: list[str]
204+
:rtype: :class:`list` of :class:`str`
205205
206206
:raises ~PowerPlatform.Dataverse.core.errors.MetadataError:
207207
If the table does not exist.
@@ -227,14 +227,14 @@ def remove_columns(
227227
"""Remove one or more columns from a table.
228228
229229
:param table: Schema name of the table (e.g. ``"new_MyTestTable"``).
230-
:type table: str
230+
:type table: :class:`str`
231231
:param columns: Column schema name or list of column schema names to
232232
remove. Must include the customization prefix (e.g.
233233
``"new_TestColumn"``).
234-
:type columns: str | list[str]
234+
:type columns: :class:`str` or :class:`list` of :class:`str`
235235
236236
:return: Schema names of the columns that were removed.
237-
:rtype: list[str]
237+
:rtype: :class:`list` of :class:`str`
238238
239239
:raises ~PowerPlatform.Dataverse.core.errors.MetadataError:
240240
If the table or a specified column does not exist.

0 commit comments

Comments
 (0)