Skip to content

Commit 58fe82e

Browse files
Abel Milashclaude
andcommitted
Fix _async_batch.py: rename r to response, simplify remove_columns loop
Rename `r` to `response` for consistency with _async_http.py. Replace multi-pass comprehension + zip in _resolve_table_remove_columns with a plain for loop matching the sync _batch.py structure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f37b9b4 commit 58fe82e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/PowerPlatform/Dataverse/aio/data/_async_batch.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def execute(
9797
headers["Prefer"] = "odata.continue-on-error"
9898

9999
url = f"{self._od.api}/$batch"
100-
r = await self._od._request(
100+
response = await self._od._request(
101101
"post",
102102
url,
103103
data=body.encode("utf-8"),
@@ -109,7 +109,7 @@ async def execute(
109109
expected=(200, 202, 207, 400),
110110
)
111111

112-
return self._parse_batch_response(r)
112+
return self._parse_batch_response(response)
113113

114114
# ------------------------------------------------------------------
115115
# Intent resolution dispatcher
@@ -273,12 +273,11 @@ async def _resolve_table_add_columns(self, op: _TableAddColumns) -> List[_RawReq
273273
async def _resolve_table_remove_columns(self, op: _TableRemoveColumns) -> List[_RawRequest]:
274274
columns = [op.columns] if isinstance(op.columns, str) else list(op.columns)
275275
metadata_id = await self._require_entity_metadata(op.table)
276-
attr_metas = [
277-
await self._od._get_attribute_metadata(metadata_id, col_name, extra_select="@odata.type,AttributeType")
278-
for col_name in columns
279-
]
280276
requests: List[_RawRequest] = []
281-
for col_name, attr_meta in zip(columns, attr_metas):
277+
for col_name in columns:
278+
attr_meta = await self._od._get_attribute_metadata(
279+
metadata_id, col_name, extra_select="@odata.type,AttributeType"
280+
)
282281
if not attr_meta or not attr_meta.get("MetadataId"):
283282
raise MetadataError(
284283
f"Column '{col_name}' not found on table '{op.table}'.",

0 commit comments

Comments
 (0)