File tree Expand file tree Collapse file tree
src/PowerPlatform/Dataverse Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1519,10 +1519,12 @@ def _get_table_metadata(
15191519 params : Dict [str , str ] = {}
15201520 if select is not None and isinstance (select , str ):
15211521 raise TypeError ("select must be a list of property names, not a bare string" )
1522+ base_fields = {"MetadataId" , "LogicalName" , "SchemaName" , "EntitySetName" }
15221523 if select :
1523- base_fields = {"MetadataId" , "LogicalName" , "SchemaName" , "EntitySetName" }
15241524 merged = list (base_fields | set (select ))
1525- params ["$select" ] = "," .join (merged )
1525+ else :
1526+ merged = list (base_fields )
1527+ params ["$select" ] = "," .join (merged )
15261528 expand_parts : List [str ] = []
15271529 if include_attributes :
15281530 expand_parts .append ("Attributes" )
Original file line number Diff line number Diff line change @@ -208,6 +208,11 @@ def get(
208208 # Extended with relationships
209209 info = client.tables.get("account", include_relationships=True)
210210 """
211+ # Normalize empty list to None so callers passing select=[] get the
212+ # lightweight path instead of an expensive full-entity-definition fetch.
213+ if select is not None and len (select ) == 0 :
214+ select = None
215+
211216 # When no extra parameters are passed, use the original lightweight lookup.
212217 # This ensures backward compatibility -- existing callers get identical behavior.
213218 if not include_columns and not include_relationships and select is None :
You can’t perform that action at this time.
0 commit comments