-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #936 from sirosen/fix-create-policy-3
Fix AuthClient.create_policy signature
- Loading branch information
Showing
5 changed files
with
136 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Changed | ||
~~~~~~~ | ||
|
||
- The argument specification for ``AuthClient.create_policy`` was incorrect. | ||
The corrected method will emit deprecation warnings if called with positional | ||
arguments, as the corrected version uses keyword-only arguments. (:pr:`NUMBER`) |
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
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
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
19 changes: 19 additions & 0 deletions
19
tests/non-pytest/mypy-ignore-tests/auth_client_create_policy.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import globus_sdk | ||
|
||
ac = globus_sdk.AuthClient() | ||
|
||
# create new policy with keyword-only args, as supported | ||
ac.create_policy( | ||
project_id="foo", | ||
display_name="My Policy", | ||
description="This is a policy", | ||
) | ||
|
||
# create using positional args (deprecated/unsupported) | ||
ac.create_policy( # type: ignore[misc] | ||
"foo", | ||
True, # type: ignore[arg-type] | ||
101, # type: ignore[arg-type] | ||
"My Policy", # type: ignore[arg-type] | ||
"This is a policy", # type: ignore[arg-type] | ||
) |