Skip to content
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

Fixed pylint issues for azure-communication-identity #39458

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AikoBB
Copy link
Member

@AikoBB AikoBB commented Jan 29, 2025

Description

Fixed the pylint issues for azure-communication-identity - #34163

  • the fix is done for azure-communication-identity
  • applied the same changes to all shared folder

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Jan 29, 2025

API change check

API changes are not detected in this pull request.

@AikoBB AikoBB marked this pull request as ready for review January 29, 2025 15:16
Copy link
Member

@l0lawrence l0lawrence left a comment

Choose a reason for hiding this comment

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

thanks!

**kwargs # type: Any
):
# type: (...) -> Tuple[CommunicationUserIdentifier, AccessToken]
scopes: List[Union[str, CommunicationTokenScope]],
Copy link
Member

Choose a reason for hiding this comment

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

why are we not typing out 'token_expires_in' here?

# type: (...) -> AccessToken
user: CommunicationUserIdentifier,
scopes: List[Union[str, CommunicationTokenScope]],
**kwargs: Any
Copy link
Member

Choose a reason for hiding this comment

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

same here :)

async def create_user_and_token(
self, scopes: List[Union[str, "CommunicationTokenScope"]], **kwargs
async def create_user_and_token( # pylint: disable=C4758
self, scopes: List[Union[str, CommunicationTokenScope]],
Copy link
Member

@l0lawrence l0lawrence Jan 29, 2025

Choose a reason for hiding this comment

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

Suggested change
self, scopes: List[Union[str, CommunicationTokenScope]],
self, scopes: List[Union[str, CommunicationTokenScope]],*, token_expires_in: Optional[timedelta] = None

Is there a reason to not do this?

Copy link
Member Author

Choose a reason for hiding this comment

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

@l0lawrence these are public APIs and it might bring breaking changes for the customers. Even when I switched to the keyword-readonly values our tests started to fail, so that's why I kept the param in kwargs. Do you think it won't introduce any breaking changes?

Copy link
Member

Choose a reason for hiding this comment

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

It should not introduce any breaking changes, when you add it to the method signature I believe it would be an keyword-only arg with a default value of None, and then in the code below on line 104 you would need to remove the kwargs.pop()

@AikoBB AikoBB requested a review from l0lawrence January 30, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants