Skip to content

Commit 185d989

Browse files
author
Max Wang
committed
remove some debug code
1 parent 5f17919 commit 185d989

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

src/dataverse_sdk/odata.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,6 @@ def _optionset_map(self, entity_set: str, attr_logical: str) -> Optional[Dict[st
758758
self._picklist_label_cache = {}
759759
if cache_key in self._picklist_label_cache:
760760
return self._picklist_label_cache[cache_key]
761-
debug_attr = attr_logical.lower().endswith("_status")
762-
763761
attr_esc = self._escape_odata_quotes(attr_logical)
764762
logical_esc = self._escape_odata_quotes(logical)
765763

@@ -769,11 +767,6 @@ def _optionset_map(self, entity_set: str, attr_logical: str) -> Optional[Dict[st
769767
f"?$filter=LogicalName eq '{attr_esc}'&$select=LogicalName,AttributeType"
770768
)
771769
r_type = self._request("get", url_type, headers=self._headers())
772-
if debug_attr:
773-
try:
774-
print({"debug_picklist_probe_type": {"attr": attr_logical, "status": r_type.status_code}})
775-
except Exception:
776-
pass
777770
if r_type.status_code == 404:
778771
# Do not permanently cache negative result; metadata may appear later.
779772
return None
@@ -783,11 +776,6 @@ def _optionset_map(self, entity_set: str, attr_logical: str) -> Optional[Dict[st
783776
if not items:
784777
return None
785778
attr_md = items[0]
786-
if debug_attr:
787-
try:
788-
print({"debug_picklist_attr_type": attr_md.get("AttributeType")})
789-
except Exception:
790-
pass
791779
if attr_md.get("AttributeType") not in ("Picklist", "PickList"):
792780
return None
793781

@@ -798,11 +786,6 @@ def _optionset_map(self, entity_set: str, attr_logical: str) -> Optional[Dict[st
798786
"Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet($select=Options)"
799787
)
800788
r_opts = self._request("get", cast_url, headers=self._headers())
801-
if debug_attr:
802-
try:
803-
print({"debug_picklist_cast_fetch": {"status": r_opts.status_code}})
804-
except Exception:
805-
pass
806789
if r_opts.status_code == 404:
807790
# Fallback: try non-cast form (older behaviour) just in case environment differs
808791
alt_url = (
@@ -826,11 +809,6 @@ def _optionset_map(self, entity_set: str, attr_logical: str) -> Optional[Dict[st
826809
options = option_set.get("Options") if isinstance(option_set, dict) else None
827810
if not isinstance(options, list):
828811
return None
829-
if debug_attr:
830-
try:
831-
print({"debug_picklist_options_count": len(options)})
832-
except Exception:
833-
pass
834812
mapping: Dict[str, int] = {}
835813
for opt in options:
836814
if not isinstance(opt, dict):
@@ -847,11 +825,6 @@ def _optionset_map(self, entity_set: str, attr_logical: str) -> Optional[Dict[st
847825
if isinstance(lab, str) and lab.strip():
848826
normalized = self._normalize_picklist_label(lab)
849827
mapping.setdefault(normalized, val)
850-
if debug_attr:
851-
try:
852-
print({"debug_picklist_mapping_keys": sorted(mapping.keys())})
853-
except Exception:
854-
pass
855828
if mapping:
856829
self._picklist_label_cache[cache_key] = mapping
857830
return mapping

0 commit comments

Comments
 (0)