8000 chore: attempt to be more informative for missing attributes by JohnVillalovos · Pull Request #1702 · python-gitlab/python-gitlab · GitHub
[go: up one dir, main page]

Skip to content

chore: attempt to be more informative for missing attributes #1702

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

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

JohnVillalovos
Copy link
Member
@JohnVillalovos JohnVillalovos commented Nov 20, 2021

A commonly reported issue from users on Gitter is that they get an
AttributeError for an attribute that should be present. This is often
caused due to the fact that they used the list() method to retrieve
the object and objects retrieved this way often only have a subset of
the full data.

Add more details in the AttributeError message that explains the
situation to users. This will hopefully allow them to resolve the
issue.

Closes #1138

@JohnVillalovos JohnVillalovos requested a review from nejch November 20, 2021 23:51
@codecov-commenter
Copy link
codecov-commenter commented Nov 21, 2021

Codecov Report

Merging #1702 (1839c9e) into main (09a973e) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1702      +/-   ##
==========================================
+ Coverage   92.01%   92.02%   +0.01%     
==========================================
  Files          75       75              
  Lines        4670     4677       +7     
==========================================
+ Hits         4297     4304       +7     
  Misses        373      373              
Flag Coverage Δ
cli_func_v4 81.44% <83.33%> (+<0.01%) ⬆️
py_func_v4 81.05% <58.33%> (-0.04%) ⬇️
unit 83.19% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/base.py 90.22% <100.00%> (+0.40%) ⬆️
gitlab/mixins.py 91.54% <100.00%> (ø)

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/attribute_help branch from dafe0be to f8dde55 Compare November 21, 2021 01:24
@nejch
Copy link
Member
nejch commented Nov 22, 2021

This will also close #1138.

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/attribute_help branch from f8dde55 to b7cd66b Compare November 23, 2021 06:05
Copy link
Member
@nejch nejch left a comment

Choose a reason for hiding this comment

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

Thanks @JohnVillalovos, just a few small notes from me.

I was thinking something similar for missing methods in e.g. Issue vs ProjectIssue to guide users towards creating the right objects or even give a make_editable() method for those to convert them. So I really like it and would maybe build on this later as well. I think there might also be a few other cases where this could be extended later, such as after running save/update and so on.

@JohnVillalovos
Copy link
Member Author

Thanks @JohnVillalovos, just a few small notes from me.

I was thinking something similar for missing methods in e.g. Issue vs ProjectIssue to guide users towards creating the right objects or even give a make_editable() method for those to convert them. So I really like it and would maybe build on this later as well. I think there might also be a few other cases where this could be extended later, such as after running save/update and so on.

Thanks for the review! Will work on updating the PR.

I like the idea of catching the common issues that users of the library encounter and trying to point them to how to fix it so they file less issues 😊

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/attribute_help branch from b7cd66b to f881a01 Compare November 23, 2021 22:23
@JohnVillalovos JohnVillalovos requested a review from nejch November 23, 2021 22:24
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/attribute_help branch 2 times, most recently from 644ef29 to 6c5fe03 Compare November 27, 2021 17:32
A commonly reported issue from users on Gitter is that they get an
AttributeError for an attribute that should be present. This is often
caused due to the fact that they used the `list()` method to retrieve
the object and objects retrieved this way often only have a subset of
the full data.

Add more details in the AttributeError message that explains the
situation to users. This will hopefully allow them to resolve the
issue.

Update the FAQ in the docs to add a section discussing the issue.

Closes #1138
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/attribute_help branch from 760beb4 to 1839c9e Compare November 30, 2021 16:36
@nejch nejch merged commit 387e59f into main Dec 1, 2021
@nejch nejch deleted the jlvillal/attribute_help branch December 1, 2021 00:32
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.

ProjectPipeline from .list(as_list=False) has fewer information than the one from .get(id)
3 participants
0