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

Fix pylint errors #39397

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

Conversation

allenkim0129
Copy link
Contributor

@allenkim0129 allenkim0129 commented Jan 24, 2025

Description

Pylint was causing PR build failures. This Fix will fix the pylint errors.
The majority of the errors were caused by response_hook parameter. response_hook parameter was added to docstrings for number of functions, but none of them were added to the definition of the functions. This caused the docstring and the function definition to be out of sync.

The main updates:

  1. If the response_hook parameter was used inside of the functions, I added the parameter to the function definition.
  2. If the response_hook parameter was not used, I removed the parameter from the docstring.
  3. If parameter types were mismatching, I updated the parameter types and docstrings.
  4. Some miner pylint checks were unable to be fixed, so I disabled those checks: (do-not-import-asyncio, do-not-log-exceptions)

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

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-cosmos

@allenkim0129 allenkim0129 marked this pull request as ready for review January 25, 2025 00:19
@allenkim0129 allenkim0129 requested review from annatisch and a team as code owners January 25, 2025 00:19
:param kwargs: Keyword arguments to verify for query_items_change_feed API
:keyword mode: Must be one of the values in the Enum, 'ChangeFeedMode'.
:param dict[str, Any] kwargs: Keyword arguments to verify for query_items_change_feed API
* keyword mode: Must be one of the values in the Enum, 'ChangeFeedMode'.
Copy link
Member

Choose a reason for hiding this comment

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

nit: * instead of :

* paramtype is_start_from_beginning: bool
* keyword start_time: Must be in supported types.
* paramtype start_time: Union[~datetime.datetime, Literal["Now", "Beginning"]]
* type kwargs: dict[str, 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 as above ^

@@ -2780,8 +2782,9 @@ async def __QueryFeed( # pylint: disable=too-many-branches,too-many-statements,
query: Optional[Union[str, Dict[str, Any]]],
options: Optional[Mapping[str, Any]] = None,
partition_key_range_id: Optional[str] = None,
response_hook: Optional[Callable[[Mapping[str, Any], Mapping[str, Any]], None]] = None,
Copy link
Member

Choose a reason for hiding this comment

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

this is being changed from a parameter to a kwarg, I want to ensure that this is intended and accurate

"""Get a sorted list of items that were changed, in the order in which they were modified.

:keyword str continuation: The continuation token retrieved from previous response. It contains chang feed mode.
Copy link
Member

Choose a reason for hiding this comment

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

instead of deleting the documentation if you don't want to list out all the args and kwargs for whatever reason could you put a #pylint:disable=the pylint rule on the offending line instead. We dont want to remove documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants