Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya-borisova committed Apr 9, 2024
1 parent f37d719 commit 1461250
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 19 deletions.
7 changes: 4 additions & 3 deletions code/backend/batch/AddURLEmbeddings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import logging
import traceback
import azure.functions as func
import sys

from backend.batch.utilities.helpers.DocumentProcessorHelper import DocumentProcessor
from backend.batch.utilities.helpers.ConfigHelper import ConfigHelper
from utilities.helpers.DocumentProcessorHelper import DocumentProcessor
from utilities.helpers.ConfigHelper import ConfigHelper


sys.path.append("..")
bp_add_url_embeddings = func.Blueprint()

logger = logging.getLogger(__name__)


Expand Down
9 changes: 5 additions & 4 deletions code/backend/batch/BatchPushResults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
import json
import azure.functions as func
from urllib.parse import urlparse
import sys

from backend.batch.utilities.helpers.AzureBlobStorageHelper import (
from utilities.helpers.AzureBlobStorageHelper import (
AzureBlobStorageClient,
)
from backend.batch.utilities.helpers.DocumentProcessorHelper import DocumentProcessor
from backend.batch.utilities.helpers.ConfigHelper import ConfigHelper
from utilities.helpers.DocumentProcessorHelper import DocumentProcessor
from utilities.helpers.ConfigHelper import ConfigHelper


sys.path.append("..")
bp_batch_push_results = func.Blueprint()

logger = logging.getLogger(__name__)


Expand Down
8 changes: 5 additions & 3 deletions code/backend/batch/BatchStartProcessing.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import logging
import json
import azure.functions as func
from backend.batch.utilities.helpers.EnvHelper import EnvHelper
from backend.batch.utilities.helpers.AzureBlobStorageHelper import (
import sys

from utilities.helpers.EnvHelper import EnvHelper
from utilities.helpers.AzureBlobStorageHelper import (
AzureBlobStorageClient,
create_queue_client,
)

bp_batch_start_processing = func.Blueprint()
env_helper: EnvHelper = EnvHelper()

logger = logging.getLogger(__name__)
sys.path.append("..")


@bp_batch_start_processing.route(route="BatchStartProcessing")
Expand Down
10 changes: 6 additions & 4 deletions code/backend/batch/GetConversationResponse.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import azure.functions as func
import logging
import json
from backend.batch.utilities.helpers.EnvHelper import EnvHelper
from backend.batch.utilities.helpers.OrchestratorHelper import Orchestrator
from backend.batch.utilities.helpers.ConfigHelper import ConfigHelper
import sys

from utilities.helpers.EnvHelper import EnvHelper
from utilities.helpers.OrchestratorHelper import Orchestrator
from utilities.helpers.ConfigHelper import ConfigHelper


sys.path.append("..")
bp_get_conversation_response = func.Blueprint()
env_helper: EnvHelper = EnvHelper()

logger = logging.getLogger(__name__)


Expand Down
6 changes: 5 additions & 1 deletion code/tests/test_AddURLEmbeddings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import sys
from unittest import mock
import azure.functions as func
from backend.batch.AddURLEmbeddings import do_add_url_embeddings

sys.path.append("backend/batch")

from backend.batch.AddURLEmbeddings import do_add_url_embeddings # noqa: E402


@mock.patch("backend.batch.AddURLEmbeddings.DocumentProcessor")
Expand Down
7 changes: 6 additions & 1 deletion code/tests/test_BatchGetConversationResponse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import sys
from unittest.mock import patch, Mock, ANY
import json

from backend.batch.GetConversationResponse import do_get_conversation_response
sys.path.append("backend/batch/")

from backend.batch.GetConversationResponse import ( # noqa: E402
do_get_conversation_response,
)


@patch("backend.batch.GetConversationResponse.Orchestrator")
Expand Down
7 changes: 5 additions & 2 deletions code/tests/test_BatchPushResults.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import sys
from unittest.mock import patch, Mock
from azure.functions import QueueMessage
from backend.batch.BatchPushResults import do_batch_push_results
from backend.batch.BatchPushResults import _get_file_name_from_message

sys.path.append("backend/batch/")
from backend.batch.BatchPushResults import do_batch_push_results # noqa: E402
from backend.batch.BatchPushResults import _get_file_name_from_message # noqa: E402


def test_get_file_name_from_message():
Expand Down
4 changes: 3 additions & 1 deletion code/tests/test_BatchStartProcessing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import sys
from unittest.mock import patch, Mock

from backend.batch.BatchStartProcessing import do_batch_start_processing
sys.path.append("backend/batch")
from backend.batch.BatchStartProcessing import do_batch_start_processing # noqa: E402


@patch("backend.batch.BatchStartProcessing.create_queue_client")
Expand Down

0 comments on commit 1461250

Please sign in to comment.