Skip to content

Commit

Permalink
Remove pylint-azure-guidelines references (#3640)
Browse files Browse the repository at this point in the history
# Description

pylint-azure-guidelines is an additional package added to precommit in
#3547 but it requires a local installation of azure-sdk-for-python, so
shelving it until promptflow-evals moves to azure-sdk-for-python repo

# All Promptflow 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](https://github.com/microsoft/promptflow/blob/main/CONTRIBUTING.md).**
- [ ] **I confirm that all new dependencies are compatible with the MIT
license.**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## 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](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.
  • Loading branch information
diondrapeck authored Aug 13, 2024
1 parent 1be5cb8 commit d72dae3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
3 changes: 1 addition & 2 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ py-version=3.9
ignore-patterns=test_*,conftest,setup,.*_utils\.py
ignore-paths=src\promptflow-evals\tests,src\promptflow-evals\samples,promptflow\evals\evaluate\_telemetry,promptflow\evals\evaluate\_batch_run_client\code_client.py,promptflow\evals\evaluate\_batch_run_client\proxy_client.py
reports=no
load-plugins=pylint_guidelines_checker

[MESSAGES CONTROL]
# For all codes, run 'pylint --list-msgs' or go to 'https://pylint.pycqa.org/en/latest/technical_reference/features.html'
Expand All @@ -13,7 +12,7 @@ load-plugins=pylint_guidelines_checker
# Let's black deal with bad-continuation

# Added disables from super-with-arguments
disable=useless-object-inheritance,missing-timeout,missing-client-constructor-parameter-kwargs,logging-fstring-interpolation,locally-disabled,fixme,cyclic-import,unnecessary-lambda-assignment,client-method-missing-type-annotations,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,client-suffix-needed,unnecessary-dunder-call,unnecessary-ellipsis,client-paging-methods-use-list,docstring-keyword-should-match-keyword-only,docstring-type-do-not-use-class,client-accepts-api-version-keyword,networking-import-outside-azure-core-transport,protected-access,missing-module-docstring,missing-client-constructor-parameter-credential
disable=useless-object-inheritance,missing-timeout,logging-fstring-interpolation,locally-disabled,fixme,cyclic-import,unnecessary-lambda-assignment,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,unnecessary-dunder-call,unnecessary-ellipsis,protected-access,missing-module-docstring

[FORMAT]
max-line-length=120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ def run(self, flow, data, evaluator_name=None, column_mapping=None, **kwargs):
) from exc

input_df = pd.DataFrame(json_data)
eval_future = self._thread_pool.submit(
self._calculate_metric, flow, input_df, column_mapping, evaluator_name
) # pylint: disable=specify-parameter-names-in-call
eval_future = self._thread_pool.submit(self._calculate_metric, flow, input_df, column_mapping, evaluator_name)
run = CodeRun(run=eval_future, input_data=data, evaluator_name=evaluator_name, aggregated_metrics=None)
aggregation_future = self._thread_pool.submit(self._calculate_aggregations, evaluator=flow, run=run)
run.aggregated_metrics = aggregation_future
Expand Down
6 changes: 2 additions & 4 deletions src/promptflow-evals/promptflow/evals/evaluate/_eval_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ class RunStatus(enum.Enum):
TERMINATED = 3


class EvalRun(
contextlib.AbstractContextManager
): # pylint: disable=too-many-instance-attributes,docstring-missing-param
class EvalRun(contextlib.AbstractContextManager): # pylint: disable=too-many-instance-attributes
"""
The simple singleton run class, used for accessing artifact store.
Expand Down Expand Up @@ -236,7 +234,7 @@ def __enter__(self):
self._start_run()
return self

def __exit__(self, exc_type, exc_value, exc_tb): # pylint: disable=docstring-missing-param
def __exit__(self, exc_type, exc_value, exc_tb):
"""The context manager exit call."""
self._end_run("FINISHED")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import uuid
from typing import Dict, List

from aiohttp.web import HTTPException # pylint: disable=networking-import-outside-azure-core-transport
from aiohttp_retry import JitterRetry, RetryClient # pylint: disable=networking-import-outside-azure-core-transport
from aiohttp.web import HTTPException
from aiohttp_retry import JitterRetry, RetryClient

from promptflow.evals._user_agent import USER_AGENT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, Dict
from urllib.parse import urljoin, urlparse

import requests # pylint: disable=networking-import-outside-azure-core-transport
import requests

from promptflow.evals._user_agent import USER_AGENT

Expand All @@ -28,6 +28,7 @@ class RAIClient:
:param token_manager: The token manager
:type token_manage: ~promptflow.evals.synthetic._model_tools._identity_manager.APITokenManager
"""

def __init__(self, azure_ai_project: Dict, token_manager: APITokenManager) -> None:
self.azure_ai_project = azure_ai_project
self.token_manager = token_manager
Expand Down

0 comments on commit d72dae3

Please sign in to comment.