Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/PowerPlatform/Dataverse/data/_odata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,9 @@ def _optionset_map(self, table_schema_name: str, attr_logical: str) -> Optional[
body_type = r_type.json()
items = body_type.get("value", []) if isinstance(body_type, dict) else []
if not items:
return None
# cache empty result
self._picklist_label_cache[cache_key] = {"map": {}, "ts": now}
return {}
Comment on lines +1018 to +1020
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the return type from None to {} is a breaking change for consumers who check for None (e.g., if result is None). This could cause existing code to behave incorrectly. Consider deprecating the None return in a separate release or updating all callers to handle empty dict, or document this breaking change explicitly in release notes.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s the same value returned when the Attribute is not a picklist. In my opinion, this approach is more consistent.

attr_md = items[0]
if attr_md.get("AttributeType") not in ("Picklist", "PickList"):
self._picklist_label_cache[cache_key] = {"map": {}, "ts": now}
Expand Down