Skip to content

docs: change image.history() return type to list (#3076)#3202

Merged
milas merged 3 commits intodocker:mainfrom
Khushiyant:image_history-docs
Jan 3, 2024
Merged

docs: change image.history() return type to list (#3076)#3202
milas merged 3 commits intodocker:mainfrom
Khushiyant:image_history-docs

Conversation

@Khushiyant
Copy link
Copy Markdown
Contributor

@Khushiyant Khushiyant commented Dec 17, 2023

Fix #3076
As mentioned in docs here, it should return str but it returns the history as list object

Currently:

history()
Show the history of an image.

Returns:
The history of the image.

Return type:
(str)

Raises:
docker.errors.APIError – If the server returns an error.

Update:

history()
Show the history of an image.

Returns:
The history of the image.

Return type:
(list)

Raises:
docker.errors.APIError – If the server returns an error.

For examples:

Basic alpine image return below history as list

[{'Comment': '', 'Created': 1701999570, 'CreatedBy': '/bin/sh -c #(nop) CMD ["/bin/sh"]', 'Id': 'sha256:<SHA>', 'Size': 0, 'Tags': ['alpine:latest']}, {'Comment': '', 'Created': 1701999570, 'CreatedBy': '/bin/sh -c #(nop) ADD file:<file> in / ', 'Id': '<missing>', 'Size': 7728526, 'Tags': None}]

@Khushiyant
Copy link
Copy Markdown
Contributor Author

@milas PTAL

Copy link
Copy Markdown
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@milas milas self-assigned this Jan 3, 2024
@milas milas enabled auto-merge (squash) January 3, 2024 18:25
@milas milas merged commit eeb9ea1 into docker:main Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image.history() returned wrong type.

2 participants