Skip to content

chore: add a lazy boolean attribute to RESTObject #2082

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
Jul 20, 2022

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovos JohnVillalovos commented Jun 20, 2022

This can be used to tell if a RESTObject was created using
lazy=True.

Add a message to the AttributeError if attribute access fails for an
instance created with lazy=True.

@JohnVillalovos JohnVillalovos requested a review from nejch June 20, 2022 18:54
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/mark_lazy_state branch from 671d02d to 7ed5620 Compare June 20, 2022 19:03
@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2022

Codecov Report

Merging #2082 (8d8f296) into main (e772248) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2082   +/-   ##
=======================================
  Coverage   95.39%   95.39%           
=======================================
  Files          79       79           
  Lines        5149     5152    +3     
=======================================
+ Hits         4912     4915    +3     
  Misses        237      237           
Flag Coverage Δ
cli_func_v4 82.58% <80.00%> (-0.01%) ⬇️
py_func_v4 81.07% <60.00%> (-0.03%) ⬇️
unit 87.01% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
gitlab/base.py 100.00% <100.00%> (ø)
gitlab/mixins.py 92.30% <100.00%> (ø)

@nejch
Copy link
Member

nejch commented Jun 21, 2022

@JohnVillalovos I don't mind this but I think it would be good to merge with a real-world use case implemented along with it, as currently this does not do anything. WDYT?

@JohnVillalovos
Copy link
Member Author

@JohnVillalovos I don't mind this but I think it would be good to merge with a real-world use case implemented along with it, as currently this does not do anything. WDYT?

Sure. Will update it either today or tomorrow.

@JohnVillalovos JohnVillalovos marked this pull request as draft June 21, 2022 15:49
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/mark_lazy_state branch from 7ed5620 to 8ba00fc Compare July 6, 2022 05:28
@JohnVillalovos
Copy link
Member Author

@JohnVillalovos I don't mind this but I think it would be good to merge with a real-world use case implemented along with it, as currently this does not do anything. WDYT?

Good idea. I added a real-world use case at the same time.

@JohnVillalovos JohnVillalovos marked this pull request as ready for review July 6, 2022 05:30
@JohnVillalovos JohnVillalovos requested a review from nejch July 6, 2022 05:30
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/mark_lazy_state branch 2 times, most recently from 7c668e0 to 7b4ecea Compare July 12, 2022 15:08
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/mark_lazy_state branch from 7b4ecea to 8d8f296 Compare July 18, 2022 05:25
@nejch
Copy link
Member

nejch commented Jul 20, 2022

Thanks @JohnVillalovos, just one more comment on the warning message, as I think it might be confusing if it raises for a real error on a method typo or so :)

This can be used to tell if a `RESTObject` was created using
`lazy=True`.

Add a message to the `AttributeError` if attribute access fails for an
instance created with `lazy=True`.
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/mark_lazy_state branch from 8d8f296 to a7e8cfb Compare July 20, 2022 15:35
@nejch nejch merged commit 2c90fd0 into main Jul 20, 2022
@nejch nejch deleted the jlvillal/mark_lazy_state branch July 20, 2022 19:17
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.

3 participants