Skip to content

Fix groups.update not appending ?asJob=True to URL when as_job=True#1770

Closed
Copilot wants to merge 1 commit intodevelopmentfrom
copilot/fix-groups-update-as-job-parameter
Closed

Fix groups.update not appending ?asJob=True to URL when as_job=True#1770
Copilot wants to merge 1 commit intodevelopmentfrom
copilot/fix-groups-update-as-job-parameter

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

When calling server.groups.update(group, as_job=True), the asJob query parameter was never added to the request URL, so the server returned a GroupItem response instead of a JobItem, causing an IndexError when the code tried to parse it as a job.

Changes

  • groups_endpoint.py: Appends ?asJob=True to the URL when as_job=True, and raises ValueError early for local groups (which don't support async updates)
  • test/test_group.py: Adds test_update_ad_async (verifies JobItem is returned) and test_update_local_async (verifies ValueError for local groups)
  • test/assets/group_update_async.xml: Adds fixture with a minimal async job response
# Previously raised: IndexError: list index out of range
job = server.groups.update(ad_group, as_job=True)
assert isinstance(job, TSC.JobItem)

Copilot AI linked an issue Apr 7, 2026 that may be closed by this pull request
@jacalata jacalata closed this Apr 7, 2026
Copilot AI changed the title [WIP] Fix groups.update to handle as_job parameter correctly Fix groups.update not appending ?asJob=True to URL when as_job=True Apr 7, 2026
Copilot stopped work on behalf of jacalata due to an error April 7, 2026 00:39
Copilot AI requested a review from jacalata April 7, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

groups.update incorrectly handles as_job parameter

2 participants