Skip to content

Commit

Permalink
Fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
crazygao committed Oct 23, 2023
1 parent 6673310 commit f38a89f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/promptflow/promptflow/_sdk/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
USE_VARIANTS,
VARIANTS,
CommonYamlFields,
ConnectionType,
)
from promptflow._sdk._errors import (
ConnectionNotFoundError,
Expand Down Expand Up @@ -811,7 +812,11 @@ def get_local_connections_from_executable(executable, client):
for n in connection_names:
try:
conn = client.connections.get(name=n, with_secrets=True)
if conn.api_base == "dummy_base" and conn.api_key == "dummy_key":
if (
conn.TYPE == ConnectionType.AZURE_OPEN_AI
and conn.api_base == "dummy_base"
and conn.api_key == "dummy_key"
):
if os.environ.get("PF_RECORDING_MODE", None) == "replay":
return {}
result[n] = conn._to_execution_connection_dict()
Expand Down
2 changes: 2 additions & 0 deletions src/promptflow/tests/sdk_cli_test/e2etests/test_flow_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ def test_connection_overwrite_model(self, local_client, local_aoai_connection):
assert run.status == "Completed"

def test_resolve_connection(self, local_client, local_aoai_connection):
if os.environ.get("PF_RECORDING_MODE", None) == "replay":
pytest.skip("Skip this test in replay mode, expected")
flow = load_flow(f"{FLOWS_DIR}/web_classification_no_variants")
connections = SubmitterHelper.resolve_connections(flow, local_client)
assert local_aoai_connection.name in connections
Expand Down

0 comments on commit f38a89f

Please sign in to comment.