Skip to content

Commit 769616b

Browse files
author
Saurabh Badenkal
committed
Fix: exclude computed display-name columns from sql_columns/odata_select
Columns with AttributeOf set are auto-generated display names (e.g. createdbyname, createdbyyominame) that cause errors in OData \ and are not real data columns. Now filtered out. Also: _list_table_relationships docstring updated for ManyToOne. 756 unit tests passing.
1 parent 76525ff commit 769616b

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

  • src/PowerPlatform/Dataverse/operations

src/PowerPlatform/Dataverse/operations/query.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,15 @@ def sql_columns(
193193

194194
raw = self._client.tables.list_columns(
195195
table,
196-
select=["LogicalName", "SchemaName", "AttributeType", "IsPrimaryId", "IsPrimaryName", "DisplayName"],
196+
select=[
197+
"LogicalName",
198+
"SchemaName",
199+
"AttributeType",
200+
"IsPrimaryId",
201+
"IsPrimaryName",
202+
"DisplayName",
203+
"AttributeOf",
204+
],
197205
filter="AttributeType ne 'Virtual'",
198206
)
199207
result: List[Dict[str, Any]] = []
@@ -203,6 +211,10 @@ def sql_columns(
203211
continue
204212
if not include_system and any(name.endswith(s) for s in _SYSTEM_SUFFIXES):
205213
continue
214+
# Skip computed display-name columns (AttributeOf is set, meaning
215+
# they are auto-generated from a lookup column)
216+
if c.get("AttributeOf"):
217+
continue
206218
# Extract display label
207219
label = ""
208220
dn = c.get("DisplayName")

0 commit comments

Comments
 (0)