question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

repository.commits.each() -> Expected type of data is [commit], got [None]

See original GitHub issue

atlassian-python-api 3.28.1

from atlassian.bitbucket import Cloud

for repository in project.repositories.each():
    for commit in repository.commits.each():
        log.info("commit = %s", commit.message)

Raises the following exception:

for commit in repository.commits.each():
  File "C:\Users\gunar\AppData\Local\Programs\Python\Python310\lib\site-packages\atlassian\bitbucket\cloud\repositories\commits.py", line 38, in each
    yield self.__get_object(super(Commits, self).get(commit.get("hash")))
  File "C:\Users\gunar\AppData\Local\Programs\Python\Python310\lib\site-packages\atlassian\bitbucket\cloud\repositories\commits.py", line 16, in __get_object
    return Commit(data, **self._new_session_args)
  File "C:\Users\gunar\AppData\Local\Programs\Python\Python310\lib\site-packages\atlassian\bitbucket\cloud\repositories\commits.py", line 63, in __init__
    super(Commit, self).__init__(None, *args, data=data, expected_type="commit", **kwargs)
  File "C:\Users\gunar\AppData\Local\Programs\Python\Python310\lib\site-packages\atlassian\bitbucket\cloud\base.py", line 22, in __init__
    raise ValueError("Expected type of data is [{}], got [{}].".format(expected_type, self.get_data("type")))
ValueError: Expected type of data is [commit], got [None].

According to Debug, the HTTP response returns a full list of commits.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
gonchikcommented, Nov 8, 2022

@Spacetown @sreway thanks for your work. Today I will deploy a new release. @gunarskepe thanks for the motivating people 😃

1reaction
yzislincommented, Nov 11, 2022

That’s exactly what I am doing. It seems to work. Just curious, is there a plan to add more endpoints in this python module to pull more data from official REST API endpoints?

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: Could not read from object database for commit-graph
We have a client that noticed errors in the Repocheck.log for a specific repository, but was unable to replicate the errors locally or...
Read more >
How to git commit nothing without an error? - Stack Overflow
I'm trying to write a fabric script ...
Read more >
Issues · atlassian-api/atlassian-python-api - GitHub
[JIRA] Change request channel type while open a ticket via API ... repository.commits.each() -> Expected type of data is [commit], got [None].
Read more >
Commits are snapshots, not diffs - The GitHub Blog
I'll be using the git/git repository checked out at v2.29.2 as an example. ... What are these types: blob , tree , and...
Read more >
Commit in Bitbucket Server shows a different username than ...
Cause. The user displayed in the "Author" column is actually the user that committed changes to the local repo which is occurs before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found