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

perf: Linting fixes #192

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions ClientAdvisor/App/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,31 @@

import httpx
import requests
from azure.identity.aio import (DefaultAzureCredential,
get_bearer_token_provider)
from azure.identity.aio import DefaultAzureCredential, get_bearer_token_provider
from backend.auth.auth_utils import get_authenticated_user_details, get_tenantid
from backend.history.cosmosdbservice import CosmosConversationClient
from backend.utils import (
convert_to_pf_format,
format_as_ndjson,
format_pf_non_streaming_response,
format_stream_response,
generateFilterString,
parse_multi_columns,
)
from db import get_connection
from dotenv import load_dotenv

# from quart.sessions import SecureCookieSessionInterface
from openai import AsyncAzureOpenAI
from quart import (Blueprint, Quart, jsonify, make_response, render_template,
request, send_from_directory)

from backend.auth.auth_utils import (get_authenticated_user_details,
get_tenantid)
from backend.history.cosmosdbservice import CosmosConversationClient
from backend.utils import (convert_to_pf_format, format_as_ndjson,
format_pf_non_streaming_response,
format_stream_response, generateFilterString,
parse_multi_columns)
from db import get_connection
from quart import (
Blueprint,
Quart,
jsonify,
make_response,
render_template,
request,
send_from_directory,
)

bp = Blueprint("routes", __name__, static_folder="static", template_folder="static")

Expand Down
3 changes: 1 addition & 2 deletions ClientAdvisor/App/tests/backend/auth/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import json
from unittest.mock import patch

from backend.auth.auth_utils import (get_authenticated_user_details,
get_tenantid)
from backend.auth.auth_utils import get_authenticated_user_details, get_tenantid


def test_get_authenticated_user_details_no_principal_id():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pytest
from azure.cosmos import exceptions

from backend.history.cosmosdbservice import CosmosConversationClient


Expand Down
17 changes: 11 additions & 6 deletions ClientAdvisor/App/tests/backend/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
from unittest.mock import MagicMock, patch

import pytest

from backend.utils import (JSONEncoder, convert_to_pf_format, fetchUserGroups,
format_as_ndjson, format_non_streaming_response,
format_pf_non_streaming_response,
format_stream_response, generateFilterString,
parse_multi_columns)
from backend.utils import (
JSONEncoder,
convert_to_pf_format,
fetchUserGroups,
format_as_ndjson,
format_non_streaming_response,
format_pf_non_streaming_response,
format_stream_response,
generateFilterString,
parse_multi_columns,
)


@dataclasses.dataclass
Expand Down
11 changes: 8 additions & 3 deletions ClientAdvisor/App/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
from unittest.mock import AsyncMock, MagicMock, patch

import pytest

from app import (create_app, delete_all_conversations, generate_title,
init_cosmosdb_client, init_openai_client, stream_chat_request)
from app import (
create_app,
delete_all_conversations,
generate_title,
init_cosmosdb_client,
init_openai_client,
stream_chat_request,
)

# Constants for testing
INVALID_API_VERSION = "2022-01-01"
Expand Down
3 changes: 1 addition & 2 deletions ClientAdvisor/App/tools/data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import os
import sys

from dotenv import load_dotenv

import app
from dotenv import load_dotenv

# import the app.py module to gain access to the methods to construct payloads and
# call the API through the sdk
Expand Down
Loading