-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BF: make it [] in case of None being returned #217
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For some reason few days ago tests started to fail on github actions but not locally. In the logs I see 2023-08-09T02:10:57.8251783Z [ERROR] Failed to execute ['/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py', 'run', '--repo-tag', 'alpine:3.16', '/tmp/pytest-of-runner/pytest-0/test_load_multi_image0/alpine', 'ls'] 2023-08-09T02:10:57.8252806Z Traceback (most recent call last): 2023-08-09T02:10:57.8254107Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 243, in <module> 2023-08-09T02:10:57.8254681Z main(sys.argv) 2023-08-09T02:10:57.8255833Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 238, in main 2023-08-09T02:10:57.8256433Z namespace.func(namespace) 2023-08-09T02:10:57.8257545Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 164, in cli_run 2023-08-09T02:10:57.8258206Z image_id = load(namespace.path, namespace.repo_tag, namespace.config) 2023-08-09T02:10:57.8259431Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 135, in load 2023-08-09T02:10:57.8260072Z image_id = "sha256:" + get_image(path, repo_tag, config) 2023-08-09T02:10:57.8261030Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 98, in get_image 2023-08-09T02:10:57.8261689Z manifest = [img for img in manifest if repo_tag in img.get("RepoTags", [])] 2023-08-09T02:10:57.8262670Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 98, in <listcomp> 2023-08-09T02:10:57.8263557Z manifest = [img for img in manifest if repo_tag in img.get("RepoTags", [])] 2023-08-09T02:10:57.8264146Z TypeError: argument of type 'NoneType' is not iterable 2023-08-09T02:10:57.8265305Z Failed to execute ['/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py', 'run', '--repo-tag', 'alpine:3.16', '/tmp/pytest-of-runner/pytest-0/test_load_multi_image0/alpine', 'ls'] 2023-08-09T02:10:57.8266015Z Traceback (most recent call last): 2023-08-09T02:10:57.8267005Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 243, in <module> 2023-08-09T02:10:57.8267538Z main(sys.argv) 2023-08-09T02:10:57.8275594Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 238, in main 2023-08-09T02:10:57.8276373Z namespace.func(namespace) 2023-08-09T02:10:57.8277519Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 164, in cli_run 2023-08-09T02:10:57.8278199Z image_id = load(namespace.path, namespace.repo_tag, namespace.config) 2023-08-09T02:10:57.8279059Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 135, in load 2023-08-09T02:10:57.8280204Z image_id = "sha256:" + get_image(path, repo_tag, config) 2023-08-09T02:10:57.8281300Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 98, in get_image 2023-08-09T02:10:57.8281972Z manifest = [img for img in manifest if repo_tag in img.get("RepoTags", [])] 2023-08-09T02:10:57.8282831Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/datalad_container/adapters/docker.py", line 98, in <listcomp> 2023-08-09T02:10:57.8283464Z manifest = [img for img in manifest if repo_tag in img.get("RepoTags", [])] 2023-08-09T02:10:57.8284095Z TypeError: argument of type 'NoneType' is not iterable which suggests that img.get("RepoTags", []) returns None, i.e. it is present but None, instead of just being absent and thus defaulting to []. With this change we should "or" into [] then. Closes datalad#216
yarikoptic
added
patch
Increment the patch version when merged
release
Create a release when this pr is merged
CHANGELOG-missing
labels
Aug 9, 2023
Code Climate has analyzed commit c17b255 and detected 0 issues on this pull request. View more on Code Climate. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #217 +/- ##
=======================================
Coverage 93.95% 93.95%
=======================================
Files 25 25
Lines 1091 1091
=======================================
Hits 1025 1025
Misses 66 66
☔ View full report in Codecov by Sentry. |
jwodder
approved these changes
Aug 9, 2023
PR released in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For some reason few days ago tests started to fail on github actions but not locally. In the logs I see
which suggests that img.get("RepoTags", []) returns None, i.e. it is present but None, instead of just being absent and thus defaulting to []. With this change we should "or" into [] then.
Closes (if succeeds testing) #216