Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nick863 committed Jul 11, 2024
1 parent 6a01486 commit 150a081
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/promptflow-evals-e2e-test-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
id: run_e2e_tests_local
run: |
poetry run pytest -m localtest tests/evals/e2etests --cov=promptflow --cov-config=pyproject.toml --cov-report=term --cov-report=html --cov-report=xml
poetry run pytest -m e2etest --cov=promptflow --cov-config=pyproject.toml --cov-report=term --cov-report=html --cov-report=xml
poetry run python ../../scripts/code_qa/report_to_app_insights.py --activity e2e_tests_local --junit-xml test-results.xml --git-hub-action-run-id ${{ github.run_id }} --git-hub-workflow ${{ github.workflow }} --git-hub-action ${{ github.action }} --git-branch ${{ github.ref }}
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: upload coverage report
Expand Down
19 changes: 11 additions & 8 deletions src/promptflow-evals/promptflow/evals/evaluate/_eval_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

# Handle optional import. The azure libraries are only present if
# promptflow-azure is installed.
_AZURE_IMPORTED = True
try:
from azure.ai.ml.entities._credentials import AccountKeyConfiguration
from azure.ai.ml.entities._datastore.datastore import Datastore
Expand All @@ -30,12 +31,11 @@
# If the above mentioned modules cannot be imported, we are running
# in local mode and MLClient in the constructor will be None, so
# we will not arrive to Azure-dependent code.
LOGGER.warning(
"azure-ai-ml cannot be imported. "
"The results will be saved locally, but will not be logged to Azure. "
"To log results to azure please install promptflow-evals with the command "
"pip install promptflow-evals[azure]"
)

# We are not logging the import failure because
# - If the project configuration was not provided this import is not needed.
# - If the project configuration was provided, the error will be raised by PFClient.
pass


@dataclasses.dataclass
Expand Down Expand Up @@ -133,8 +133,11 @@ def __init__(self,
self._is_promptflow_run: bool = promptflow_run is not None
self._is_broken = False
if self._tracking_uri is None:
LOGGER.warning("tracking_uri was not provided, "
"The results will be saved locally, but will not be logged to Azure.")
if self._tracking_uri:
LOGGER.warning(
"tracking_uri was not provided, "
"The results will be saved locally, but will not be logged to Azure."
)
self._url_base = None
self._is_broken = True
self.info = RunInfo.generate(run_name)
Expand Down

0 comments on commit 150a081

Please sign in to comment.