Title: AttributeError: 'dict' object has no attribute 'version_type' when trying to use git_client.get_commits search_criteria · Issue #526 · microsoft/azure-devops-python-api · GitHub
Open Graph Title: AttributeError: 'dict' object has no attribute 'version_type' when trying to use git_client.get_commits search_criteria · Issue #526 · microsoft/azure-devops-python-api
X Title: AttributeError: 'dict' object has no attribute 'version_type' when trying to use git_client.get_commits search_criteria · Issue #526 · microsoft/azure-devops-python-api
Description: When trying to get all the commits on a branch I get an attribute error. Code: from azure.devops.connection import Connection from azure.devops.v7_0.git import GitClient from azure.devops.v7_0.git.models import GitQueryCommitsCriteria fr...
Open Graph Description: When trying to get all the commits on a branch I get an attribute error. Code: from azure.devops.connection import Connection from azure.devops.v7_0.git import GitClient from azure.devops.v7_0.git....
X Description: When trying to get all the commits on a branch I get an attribute error. Code: from azure.devops.connection import Connection from azure.devops.v7_0.git import GitClient from azure.devops.v7_0.git....
Opengraph URL: https://github.com/microsoft/azure-devops-python-api/issues/526
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AttributeError: 'dict' object has no attribute 'version_type' when trying to use git_client.get_commits search_criteria","articleBody":"When trying to get all the commits on a branch I get an attribute error.\n\nCode:\nfrom azure.devops.connection import Connection\nfrom azure.devops.v7_0.git import GitClient\nfrom azure.devops.v7_0.git.models import GitQueryCommitsCriteria\nfrom msrest.authentication import BasicAuthentication\n\n cm_search_criteria = GitQueryCommitsCriteria(\n item_version={\"version\": branch_name,\"versionType\": 'branch'}\n )\n \n print (f\"search critera\")\n print (cm_search_criteria)\n print (f\"search critera\")\n \n commits = git_client.get_commits(\n repo_name,\n project=project_name,\n search_criteria=cm_search_criteria\n ) \n\nResults:\nTraceback (most recent call last):\n File \"C:\\PythonWork\\Tool Connectivity\\ADO_ALL_REPOS_BRANCHES_COMMITS.py\", line 66, in \u003cmodule\u003e\n commits = git_client.get_commits(\n repo_name,\n project=project_name,\n search_criteria=cm_search_criteria\n )\n File \"C:\\Users\\tmoran\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\azure\\devops\\v7_0\\git\\git_client_base.py\", line 361, in get_commits\n if search_criteria.item_version.version_type is not None:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: 'dict' object has no attribute 'version_type'\n\nI cannot see anything wrong with the code, but it is throwing an error, does any one see an error?","author":{"url":"https://github.com/SCMSADMIN","@type":"Person","name":"SCMSADMIN"},"datePublished":"2025-06-26T02:31:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/526/azure-devops-python-api/issues/526"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:26017bfe-3892-5afb-9ff7-06c9c2d8ecee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8944:BD9D0:7ECF3C:A844FC:697D2AF3 |
| html-safe-nonce | 0c1c44a1d32b67a586e12f68022e30f1b5b729a4f0d4b3bdfb93071dd2cdb2e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTQ0OkJEOUQwOjdFQ0YzQzpBODQ0RkM6Njk3RDJBRjMiLCJ2aXNpdG9yX2lkIjoiNjA4OTk4NzUwODM0NTMxODEzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | be92939e67316f201feaa47344195ad497f571e114778fec7040dc6060a81661 |
| hovercard-subject-tag | issue:3177517736 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/azure-devops-python-api/526/issue_layout |
| twitter:image | https://opengraph.githubassets.com/506078a3ee53756e63b16a488865dc10ac21d62cdb0084e6995055ef86a09fa1/microsoft/azure-devops-python-api/issues/526 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/506078a3ee53756e63b16a488865dc10ac21d62cdb0084e6995055ef86a09fa1/microsoft/azure-devops-python-api/issues/526 |
| og:image:alt | When trying to get all the commits on a branch I get an attribute error. Code: from azure.devops.connection import Connection from azure.devops.v7_0.git import GitClient from azure.devops.v7_0.git.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SCMSADMIN |
| hostname | github.com |
| expected-hostname | github.com |
| None | 947d30920225f8abb17692477afd5992252045b901780d1bc8fa47c03b5fde64 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/azure-devops-python-api git https://github.com/microsoft/azure-devops-python-api.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 107710074 |
| octolytics-dimension-repository_nwo | microsoft/azure-devops-python-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 107710074 |
| octolytics-dimension-repository_network_root_nwo | microsoft/azure-devops-python-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 92fcc0e25bb4da7fe9a458840cb7f3cafa272eb8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width