Skip to content

chore: require kwargs for utils.copy_dict() #1871

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
Feb 3, 2022
Merged

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovos JohnVillalovos commented Feb 2, 2022

The non-keyword arguments were a tiny bit confusing as the destination was
first and the source was second.

Change the order and require key-word only arguments to ensure we
don't silently break anyone.

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2022

Codecov Report

Merging #1871 (7cf35b2) into main (64d01ef) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1871   +/-   ##
=======================================
  Coverage   92.51%   92.51%           
=======================================
  Files          78       78           
  Lines        4878     4878           
=======================================
  Hits         4513     4513           
  Misses        365      365           
Flag Coverage Δ
cli_func_v4 81.59% <75.00%> (ø)
py_func_v4 80.42% <100.00%> (ø)
unit 83.37% <75.00%> (ø)

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

Impacted Files Coverage Δ
gitlab/client.py 90.55% <100.00%> (ø)
gitlab/utils.py 87.09% <100.00%> (ø)

@nejch
Copy link
Member

nejch commented Feb 3, 2022

Non-keyword arguments are a tiny bit confusing as the destination is first and the source is second.

Should we switch them everywhere? If someone uses this undocumented function outside the library I would be slightly confused :D

@JohnVillalovos
Copy link
Member Author

Non-keyword arguments are a tiny bit confusing as the destination is first and the source is second.

Should we switch them everywhere? If someone uses this undocumented function outside the library I would be slightly confused :D

Sorry I don't understand? Switch what everywhere?

Maybe my description should have been:

The non-keyword argument order in utils.copy_dict() is confusing as the destination is first and the source is second.

@nejch
Copy link
Member

nejch commented Feb 3, 2022

I understand, but since we're already making a breaking change by introducing required keyword arguments, we can also switch them to be src first, dest, second - both in the definition and when they're called. Would that make sense?

@JohnVillalovos
Copy link
Member Author

I guess I don't think of it as a breaking change. But maybe that means we need to define what is considered a breaking change.

What part of the API do we consider covered for it be a breaking change? We probably need to document that. I don't think an internal utility library function is part of our API.

@nejch
Copy link
Member

nejch commented Feb 3, 2022

I guess I don't think of it as a breaking change. But maybe that means we need to define what is considered a breaking change.

What part of the API do we consider covered for it be a breaking change? We probably need to document that. I don't think an internal utility library function is part of our API.

Sorry, I wasn't super clear there, I didn't mean something user-facing or to add to the changelog, just that the way the function can be used now has changed. So if we're already doing that, we can also correct the order and switch the args :)

@JohnVillalovos
Copy link
Member Author

Sorry, I wasn't super clear there, I didn't mean something user-facing or to add to the changelog, just that the way the function can be used now has changed. So if we're already doing that, we can also correct the order and switch the args :)

Ah! That makes total sense to me 👍

The non-keyword arguments were a tiny bit confusing as the destination was
first and the source was second.

Change the order and require key-word only arguments to ensure we
don't silently break anyone.
@nejch nejch merged commit 2adf31d into main Feb 3, 2022
@nejch nejch deleted the jlvillal/copy_dict branch February 3, 2022 22:16
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