[prompty] Expose Prompty class as public #9338
14 errors, 46 fail, 30 skipped, 141 pass in 4m 10s
4 files 4 suites 4m 10s ⏱️
231 tests 141 ✅ 30 💤 46 ❌ 14 🔥
924 runs 564 ✅ 120 💤 184 ❌ 56 🔥
Results for commit 2cab229.
Annotations
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs with error: tests.sdk_cli_azure_test.unittests.test_trace
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
collection failure
ImportError while importing test module '/home/runner/work/promptflow/promptflow/src/promptflow-azure/tests/sdk_cli_azure_test/unittests/test_trace.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/_pytest/python.py:520: in importtestmodule
mod = import_path(
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/_pytest/pathlib.py:584: in import_path
importlib.import_module(module_name)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
tests/sdk_cli_azure_test/unittests/test_trace.py:9: in <module>
from promptflow.azure._utils._tracing import _init_workspace_cosmos_db
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
promptflow/azure/_utils/_tracing.py:12: in <module>
from promptflow._sdk._tracing import PF_CONFIG_TRACE_LOCAL
E ImportError: cannot import name 'PF_CONFIG_TRACE_LOCAL' from 'promptflow._sdk._tracing' (/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_tracing.py)
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_summary.TestSummary
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_aggregate_node_span_does_not_persist (tests.sdk_cli_azure_test.unittests.test_summary.TestSummary)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: type object 'SpanAttributeFieldName' has no attribute 'IS_AGGREGATION'
self = <sdk_cli_azure_test.unittests.test_summary.TestSummary object at 0x7fa7be31ce80>
def test_aggregate_node_span_does_not_persist(self):
mock_client = mock.Mock()
> self.summary.span.attributes.update({SpanAttributeFieldName.IS_AGGREGATION: True})
E AttributeError: type object 'SpanAttributeFieldName' has no attribute 'IS_AGGREGATION'
tests/sdk_cli_azure_test/unittests/test_summary.py:59: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_summary.TestSummary
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_non_root_span_persist_running_node (tests.sdk_cli_azure_test.unittests.test_summary.TestSummary)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: type object 'SpanAttributeFieldName' has no attribute 'IS_AGGREGATION'
self = <sdk_cli_azure_test.unittests.test_summary.TestSummary object at 0x7fa7be308490>
def test_non_root_span_persist_running_node(self):
mock_client = mock.Mock()
self.summary.span.parent_id = "parent_span_id"
with mock.patch.multiple(
self.summary,
_persist_running_item=mock.DEFAULT,
_persist_line_run=mock.DEFAULT,
_insert_evaluation_with_retry=mock.DEFAULT,
) as values:
> self.summary.persist(mock_client)
tests/sdk_cli_azure_test/unittests/test_summary.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._storage.cosmosdb.summary.Summary object at 0x7fa7be041a60>
client = <Mock id='140358424206064'>
def persist(self, client: ContainerProxy):
> if self.span.attributes.get(SpanAttributeFieldName.IS_AGGREGATION, False):
E AttributeError: type object 'SpanAttributeFieldName' has no attribute 'IS_AGGREGATION'
promptflow/azure/_storage/cosmosdb/summary.py:68: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_summary.TestSummary
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_root_span_persist_main_line (tests.sdk_cli_azure_test.unittests.test_summary.TestSummary)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: type object 'SpanAttributeFieldName' has no attribute 'IS_AGGREGATION'
self = <sdk_cli_azure_test.unittests.test_summary.TestSummary object at 0x7fa7be3080a0>
def test_root_span_persist_main_line(self):
mock_client = mock.Mock()
self.summary.span.parent_id = None
attributes = self.summary.span.attributes
attributes.pop(SpanAttributeFieldName.LINE_RUN_ID, None)
attributes.pop(SpanAttributeFieldName.BATCH_RUN_ID, None)
with mock.patch.multiple(
self.summary,
_persist_running_item=mock.DEFAULT,
_persist_line_run=mock.DEFAULT,
_insert_evaluation_with_retry=mock.DEFAULT,
) as values:
> self.summary.persist(mock_client)
tests/sdk_cli_azure_test/unittests/test_summary.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._storage.cosmosdb.summary.Summary object at 0x7fa7be14e310>
client = <Mock id='140358425305728'>
def persist(self, client: ContainerProxy):
> if self.span.attributes.get(SpanAttributeFieldName.IS_AGGREGATION, False):
E AttributeError: type object 'SpanAttributeFieldName' has no attribute 'IS_AGGREGATION'
promptflow/azure/_storage/cosmosdb/summary.py:68: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_summary.TestSummary
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_root_eval_span_persist_eval (tests.sdk_cli_azure_test.unittests.test_summary.TestSummary)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: type object 'SpanAttributeFieldName' has no attribute 'IS_AGGREGATION'
self = <sdk_cli_azure_test.unittests.test_summary.TestSummary object at 0x7fa7be308850>
def test_root_eval_span_persist_eval(self):
mock_client = mock.Mock()
self.summary.span.parent_id = None
self.summary.span.attributes[SpanAttributeFieldName.LINE_RUN_ID] = "line_run_id"
self.summary.span.attributes[SpanAttributeFieldName.REFERENCED_LINE_RUN_ID] = "main_line_run_id"
with mock.patch.multiple(
self.summary,
_persist_running_item=mock.DEFAULT,
_persist_line_run=mock.DEFAULT,
_insert_evaluation_with_retry=mock.DEFAULT,
) as values:
> self.summary.persist(mock_client)
tests/sdk_cli_azure_test/unittests/test_summary.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._storage.cosmosdb.summary.Summary object at 0x7fa7be1606d0>
client = <Mock id='140358425380704'>
def persist(self, client: ContainerProxy):
> if self.span.attributes.get(SpanAttributeFieldName.IS_AGGREGATION, False):
E AttributeError: type object 'SpanAttributeFieldName' has no attribute 'IS_AGGREGATION'
promptflow/azure/_storage/cosmosdb/summary.py:68: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_run_bulk (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf5439d0>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7dceeafa00>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7f7dcf0a0af0>
def test_run_bulk(self, pf, runtime: str, randstr: Callable[[str], str]):
name = randstr("name")
> run = pf.run(
flow=f"{FLOWS_DIR}/web_classification",
data=f"{DATAS_DIR}/webClassification1.jsonl",
column_mapping={"url": "${data.url}"},
variant="${summarize_text_content.variant_0}",
runtime=runtime,
name=name,
)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
promptflow/azure/_pf_client.py:303: in run
return self.runs.create_or_update(run=run, **kwargs)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7de3ba96d0>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_cli.TestAzureCli
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_pf_azure_version (tests.sdk_cli_azure_test.unittests.test_cli.TestAzureCli)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
assert '0.0.1' in '{\n "promptflow": "1.9.0",\n "promptflow-azure": "1.9.0.dev0",\n "promptflow-core": "1.9.0",\n "promptflow-devkit": "1.9.0",\n "promptflow-tracing": "1.9.0"\n}\n\nExecutable \'/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/bin/python\'\nPython (Linux) 3.9.19 (main, Mar 20 2024, 16:40:02) \n[GCC 11.4.0]\n'
self = <sdk_cli_azure_test.unittests.test_cli.TestAzureCli object at 0x7fa7be5aeee0>
capfd = <_pytest.capture.CaptureFixture object at 0x7fa7d2d26cd0>
def test_pf_azure_version(self, capfd):
run_pf_command("--version")
out, err = capfd.readouterr()
> assert "0.0.1" in out
E assert '0.0.1' in '{\n "promptflow": "1.9.0",\n "promptflow-azure": "1.9.0.dev0",\n "promptflow-core": "1.9.0",\n "promptflow-devkit": "1.9.0",\n "promptflow-tracing": "1.9.0"\n}\n\nExecutable \'/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/bin/python\'\nPython (Linux) 3.9.19 (main, Mar 20 2024, 16:40:02) \n[GCC 11.4.0]\n'
tests/sdk_cli_azure_test/unittests/test_cli.py:48: AssertionError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_ignore_files_in_flow (tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.unittests.test_flow_entity.TestFlow object at 0x7fa7be2ad490>
def test_ignore_files_in_flow(self):
local_file = FLOWS_DIR / "web_classification"
with tempfile.TemporaryDirectory() as temp:
flow_path = Path(temp) / "flow"
shutil.copytree(local_file, flow_path)
assert (Path(temp) / "flow/.promptflow/flow.tools.json").exists()
(Path(flow_path) / ".runs").mkdir(parents=True)
(Path(flow_path) / ".runs" / "mock.file").touch()
flow = load_flow(source=flow_path)
> with flow._build_code() as code:
tests/sdk_cli_azure_test/unittests/test_flow_entity.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7fa7d29354c0>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_flow_with_additional_includes (tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.unittests.test_flow_entity.TestFlow object at 0x7fa7be3b8190>
def test_flow_with_additional_includes(self):
flow_folder = FLOWS_DIR / "web_classification_with_additional_include"
flow = load_flow(source=flow_folder)
> with flow._build_code() as code:
tests/sdk_cli_azure_test/unittests/test_flow_entity.py:136:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7fa7d2bd65e0>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_flow_with_ignore_file (tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.unittests.test_flow_entity.TestFlow object at 0x7fa7be3b82e0>
def test_flow_with_ignore_file(self):
flow_folder = FLOWS_DIR / "flow_with_ignore_file"
flow = load_flow(source=flow_folder)
> with flow._build_code() as code:
tests/sdk_cli_azure_test/unittests/test_flow_entity.py:162:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7fa7d2d8cb80>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_resolve_requirements_for_flow (tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.unittests.test_flow_entity.TestFlow object at 0x7fa7be3b8940>
def test_resolve_requirements_for_flow(self):
with tempfile.TemporaryDirectory() as temp:
temp = Path(temp)
# flow without environment section
flow_folder = FLOWS_DIR / "flow_with_requirements_txt"
shutil.copytree(flow_folder, temp / "flow_with_requirements_txt")
flow_folder = temp / "flow_with_requirements_txt"
flow = load_flow(source=flow_folder)
> with flow._build_code():
tests/sdk_cli_azure_test/unittests/test_flow_entity.py:198:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7fa7d2d3cd60>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_flow_resolve_environment (tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.unittests.test_flow_entity.TestFlow object at 0x7fa7be3bfb20>
def test_flow_resolve_environment(self):
with tempfile.TemporaryDirectory() as temp:
temp = Path(temp)
# flow without env
shutil.copytree(FLOWS_DIR / "hello-world", temp / "hello-world")
flow = load_flow(source=temp / "hello-world")
> with flow._build_code():
tests/sdk_cli_azure_test/unittests/test_flow_entity.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7fa7d2aff820>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_run_bulk_from_yaml (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf54af10>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7de34cbc10>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7f7de380f3a0>
def test_run_bulk_from_yaml(self, pf, runtime: str, randstr: Callable[[str], str]):
run_id = randstr("run_id")
run = load_run(
source=f"{RUNS_DIR}/sample_bulk_run_cloud.yaml",
params_override=[{"name": run_id, "runtime": runtime}],
)
> run = pf.runs.create_or_update(run=run)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:210:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7df5892310>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_flex_flow_run_unsupported_types[UserErrorException-data3-'init.obj_input.type': 'Must be one of] (tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
Failed: DID NOT RAISE <class 'promptflow.exceptions.UserErrorException'>
self = <sdk_cli_azure_test.unittests.test_flow_entity.TestFlow object at 0x7fa7be3bffa0>
exception_type = <class 'promptflow.exceptions.UserErrorException'>
data = {'entry': 'simple_callable_class:MyFlow', 'init': {'obj_input': {'type': 'Object'}}, 'inputs': {'func_input': {'type': 'string'}}, 'outputs': {'func_input': {'type': 'string'}, 'obj_id': {'type': 'string'}, 'obj_input': {'type': 'string'}}}
error_message = "'init.obj_input.type': 'Must be one of"
@pytest.mark.parametrize(
"exception_type, data, error_message",
[
(
GenerateFlowMetaJsonError,
{"entry": "invalid_call:MyFlow"},
"The input 'func_input' is of a complex python type",
),
(
GenerateFlowMetaJsonError,
{"entry": "invalid_init:MyFlow"},
"The input 'obj_input' is of a complex python type",
),
(
GenerateFlowMetaJsonError,
{"entry": "invalid_output:MyFlow"},
"The output 'obj_input' is of a complex python type",
),
(
UserErrorException,
{
"entry": "simple_callable_class:MyFlow",
"init": {
"obj_input": {
"type": "Object",
}
},
},
"'init.obj_input.type': 'Must be one of",
),
(
UserErrorException,
{
"entry": "simple_callable_class:MyFlow",
"inputs": {
"func_input": {
"type": "Object",
}
},
},
"'inputs.func_input.type': 'Must be one of",
),
(
UserErrorException,
{
"entry": "simple_callable_class:MyFlow",
"outputs": {
"func_input": {
"type": "Object",
}
},
},
"Provided signature of outputs does not match the entry",
),
],
)
def test_flex_flow_run_unsupported_types(self, exception_type, data, error_message):
with pytest.raises(exception_type) as e:
> Flow._resolve_signature(
code=Path(f"{EAGER_FLOWS_DIR}/invalid_illegal_input_type"),
data=data,
)
E Failed: DID NOT RAISE <class 'promptflow.exceptions.UserErrorException'>
tests/sdk_cli_azure_test/unittests/test_flow_entity.py:305: Failed
Check warning on line 0 in tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_flex_flow_run_unsupported_types[UserErrorException-data4-'inputs.func_input.type': 'Must be one of] (tests.sdk_cli_azure_test.unittests.test_flow_entity.TestFlow)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
Failed: DID NOT RAISE <class 'promptflow.exceptions.UserErrorException'>
self = <sdk_cli_azure_test.unittests.test_flow_entity.TestFlow object at 0x7fa7be3bf0a0>
exception_type = <class 'promptflow.exceptions.UserErrorException'>
data = {'entry': 'simple_callable_class:MyFlow', 'init': {'obj_input': {'type': 'string'}}, 'inputs': {'func_input': {'type': 'Object'}}, 'outputs': {'func_input': {'type': 'string'}, 'obj_id': {'type': 'string'}, 'obj_input': {'type': 'string'}}}
error_message = "'inputs.func_input.type': 'Must be one of"
@pytest.mark.parametrize(
"exception_type, data, error_message",
[
(
GenerateFlowMetaJsonError,
{"entry": "invalid_call:MyFlow"},
"The input 'func_input' is of a complex python type",
),
(
GenerateFlowMetaJsonError,
{"entry": "invalid_init:MyFlow"},
"The input 'obj_input' is of a complex python type",
),
(
GenerateFlowMetaJsonError,
{"entry": "invalid_output:MyFlow"},
"The output 'obj_input' is of a complex python type",
),
(
UserErrorException,
{
"entry": "simple_callable_class:MyFlow",
"init": {
"obj_input": {
"type": "Object",
}
},
},
"'init.obj_input.type': 'Must be one of",
),
(
UserErrorException,
{
"entry": "simple_callable_class:MyFlow",
"inputs": {
"func_input": {
"type": "Object",
}
},
},
"'inputs.func_input.type': 'Must be one of",
),
(
UserErrorException,
{
"entry": "simple_callable_class:MyFlow",
"outputs": {
"func_input": {
"type": "Object",
}
},
},
"Provided signature of outputs does not match the entry",
),
],
)
def test_flex_flow_run_unsupported_types(self, exception_type, data, error_message):
with pytest.raises(exception_type) as e:
> Flow._resolve_signature(
code=Path(f"{EAGER_FLOWS_DIR}/invalid_illegal_input_type"),
data=data,
)
E Failed: DID NOT RAISE <class 'promptflow.exceptions.UserErrorException'>
tests/sdk_cli_azure_test/unittests/test_flow_entity.py:305: Failed
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_basic_evaluation (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf54d4c0>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7dcf2c38e0>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7f7de380f8b0>
def test_basic_evaluation(self, pf, runtime: str, randstr: Callable[[str], str]):
data_path = f"{DATAS_DIR}/webClassification3.jsonl"
> run = pf.run(
flow=f"{FLOWS_DIR}/web_classification",
data=data_path,
column_mapping={"url": "${data.url}"},
variant="${summarize_text_content.variant_0}",
runtime=runtime,
name=randstr("batch_run_name"),
)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
promptflow/azure/_pf_client.py:303: in run
return self.runs.create_or_update(run=run, **kwargs)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7dea11c970>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_telemetry.TestTelemetry
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_inner_function_call (tests.sdk_cli_azure_test.e2etests.test_telemetry.TestTelemetry)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_telemetry.TestTelemetry object at 0x7fa7be5433a0>
pf = <promptflow.azure._pf_client.PFClient object at 0x7fa7d2bccb80>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7fa7d2cdd280>
def test_inner_function_call(self, pf, runtime: str, randstr: Callable[[str], str]):
request_ids = set()
first_sdk_calls = []
def check_inner_call(*args, **kwargs):
if "extra" in kwargs:
request_id = pydash.get(kwargs, "extra.custom_dimensions.request_id")
first_sdk_call = pydash.get(kwargs, "extra.custom_dimensions.first_call")
request_ids.add(request_id)
first_sdk_calls.append(first_sdk_call)
with patch.object(Logger, "info") as mock_logger:
mock_logger.side_effect = check_inner_call
run = load_run(
source=f"{RUNS_DIR}/run_with_env.yaml",
params_override=[{"runtime": runtime}],
)
run.name = randstr("name")
> pf.runs.create_or_update(run=run)
tests/sdk_cli_azure_test/e2etests/test_telemetry.py:308:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7fa7d2d1c700>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_basic_evaluation_without_data (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf54da30>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7de37fef70>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7f7dcf0a0670>
def test_basic_evaluation_without_data(self, pf, runtime: str, randstr: Callable[[str], str]):
> run = pf.run(
flow=f"{FLOWS_DIR}/web_classification",
data=f"{DATAS_DIR}/webClassification3.jsonl",
column_mapping={"url": "${data.url}"},
variant="${summarize_text_content.variant_0}",
runtime=runtime,
name=randstr("batch_run_name"),
)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:241:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
promptflow/azure/_pf_client.py:303: in run
return self.runs.create_or_update(run=run, **kwargs)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7de3393f10>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check failure on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs with error: test_run_bulk_with_remote_flow (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
failed on setup with "AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'"
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7de34cb0d0>
randstr = <function randstr.<locals>.generate_random_string at 0x7f7de367f280>
variable_recorder = <promptflow.recording.azure.variable_recorder.VariableRecorder object at 0x7f7de37d2340>
@pytest.fixture(scope=package_scope_in_live_mode())
def created_flow(pf: PFClient, randstr: Callable[[str], str], variable_recorder) -> Flow:
"""Create a flow for test."""
flow_display_name = randstr("flow_display_name")
flow_source = FLOWS_DIR / "simple_hello_world"
description = "test flow description"
tags = {"owner": "sdk-test"}
> result = pf.flows.create_or_update(
flow=flow_source, display_name=flow_display_name, type=FlowType.STANDARD, description=description, tags=tags
)
tests/sdk_cli_azure_test/conftest.py:450:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_flow_operations.py:142: in create_or_update
file_share_flow_path = self._resolve_flow_code_and_upload_to_file_share(flow=azure_flow)
promptflow/azure/operations/_flow_operations.py:273: in _resolve_flow_code_and_upload_to_file_share
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7de3aba760>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_run_with_connection_overwrite (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf551100>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7df557afa0>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7f7de380fe50>
def test_run_with_connection_overwrite(self, pf, runtime: str, randstr: Callable[[str], str]):
> run = pf.run(
flow=f"{FLOWS_DIR}/web_classification",
data=f"{DATAS_DIR}/webClassification1.jsonl",
column_mapping={"url": "${data.url}"},
variant="${summarize_text_content.variant_0}",
connections={"classify_with_llm": {"connection": "azure_open_ai", "model": "gpt-3.5-turbo"}},
runtime=runtime,
name=randstr("name"),
)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:314:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
promptflow/azure/_pf_client.py:303: in run
return self.runs.create_or_update(run=run, **kwargs)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7de35d9d00>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_run_with_env_overwrite (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf554100>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7de37da490>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7f7dea09a280>
def test_run_with_env_overwrite(self, pf, runtime: str, randstr: Callable[[str], str]):
run = load_run(
source=f"{RUNS_DIR}/run_with_env.yaml",
params_override=[{"runtime": runtime}],
)
run.name = randstr("name")
> run = pf.runs.create_or_update(run=run)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:331:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7de38d3dc0>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_run_display_name_with_macro (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf554670>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7de39c9340>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7f7de38e5e50>
def test_run_display_name_with_macro(self, pf, runtime: str, randstr: Callable[[str], str]):
run = load_run(
source=f"{RUNS_DIR}/run_with_env.yaml",
params_override=[{"runtime": runtime}],
)
run.name = randstr("name")
run.display_name = "my_display_name_${variant_id}_${timestamp}"
> run = pf.runs.create_or_update(run=run)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:341:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7de33a5100>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_default_run_display_name (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf554be0>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7de3afbfa0>
runtime = 'test-runtime-ci'
randstr = <function randstr.<locals>.generate_random_string at 0x7f7de35ce5e0>
def test_default_run_display_name(self, pf, runtime: str, randstr: Callable[[str], str]):
run = load_run(
source=f"{RUNS_DIR}/run_with_env.yaml",
params_override=[{"runtime": runtime}],
)
run.name = randstr("name")
> run = pf.runs.create_or_update(run=run)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:352:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7de3612490>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check warning on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs failed: test_run_with_remote_data (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
self = <sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun object at 0x7f7dcf5561c0>
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7de3190c70>
runtime = 'test-runtime-ci'
remote_web_classification_data = Data({'path': 'azureml://subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/00000/workspaces/00000/data...<msrest.serialization.Serializer object at 0x7f7de3be1d30>, 'version': '1', 'latest_version': None, 'datastore': None})
randstr = <function randstr.<locals>.generate_random_string at 0x7f7de367f040>
def test_run_with_remote_data(
self, pf, runtime: str, remote_web_classification_data, randstr: Callable[[str], str]
):
# run with arm id
> run = pf.run(
flow=f"{FLOWS_DIR}/web_classification",
data=f"azureml:{remote_web_classification_data.id}",
column_mapping={"url": "${data.url}"},
variant="${summarize_text_content.variant_0}",
runtime=runtime,
name=randstr("name1"),
)
tests/sdk_cli_azure_test/e2etests/test_run_operations.py:360:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
promptflow/azure/_pf_client.py:303: in run
return self.runs.create_or_update(run=run, **kwargs)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7dced62490>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError
Check failure on line 0 in tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun
github-actions / promptflow SDK CLI Azure E2E Test Result [zhrua/expose_prompty](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-azure-e2e-test.yml?query=branch:zhrua/expose_prompty++)
All 4 runs with error: test_show_run (tests.sdk_cli_azure_test.e2etests.test_run_operations.TestFlowRun)
artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
failed on setup with "AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'"
pf = <promptflow.azure._pf_client.PFClient object at 0x7f7de3b720a0>
randstr = <function randstr.<locals>.generate_random_string at 0x7f7de3a08dc0>
runtime = 'test-runtime-ci'
@pytest.fixture(scope=package_scope_in_live_mode())
def created_batch_run_without_llm(pf: PFClient, randstr: Callable[[str], str], runtime: str) -> Run:
"""Create a batch run that does not require LLM."""
name = randstr("batch_run_name")
> run = pf.run(
# copy test_configs/flows/simple_hello_world to a separate folder
# as pf.run will generate .promptflow/flow.tools.json
# it will affect Azure file share upload logic and replay test
flow=f"{FLOWS_DIR}/hello-world",
data=f"{DATAS_DIR}/webClassification3.jsonl",
column_mapping={"name": "${data.url}"},
name=name,
display_name="sdk-cli-test-fixture-batch-run-without-llm",
)
tests/sdk_cli_azure_test/conftest.py:479:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
promptflow/azure/_pf_client.py:303: in run
return self.runs.create_or_update(run=run, **kwargs)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/promptflow/_sdk/_telemetry/activity.py:265: in wrapper
return f(self, *args, **kwargs)
promptflow/azure/operations/_run_operations.py:167: in create_or_update
rest_obj = self._resolve_dependencies_in_parallel(run=run, runtime=kwargs.get("runtime"), reset=reset)
promptflow/azure/operations/_run_operations.py:847: in _resolve_dependencies_in_parallel
task_results = [task.result() for task in tasks]
promptflow/azure/operations/_run_operations.py:847: in <listcomp>
task_results = [task.result() for task in tasks]
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:439: in result
return self.__get_result()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
promptflow/azure/operations/_run_operations.py:730: in _resolve_flow_and_session_id
self._flow_operations._resolve_arm_id_or_upload_dependencies(
promptflow/azure/operations/_flow_operations.py:474: in _resolve_arm_id_or_upload_dependencies
self._try_resolve_code_for_flow(flow=flow, ops=ops, ignore_tools_json=ignore_tools_json)
promptflow/azure/operations/_flow_operations.py:486: in _try_resolve_code_for_flow
with flow._build_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
/home/runner/.cache/pypoetry/virtualenvs/promptflow-azure--uht9Cw5-py3.9/lib/python3.9/site-packages/azure/ai/ml/entities/_component/code.py:262: in _build_code
with self._try_build_local_code() as code:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/contextlib.py:119: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <promptflow.azure._entities._flow.Flow object at 0x7f7de34cb400>
@contextmanager
def _try_build_local_code(self) -> Optional[Code]:
"""Try to create a Code object pointing to local code and yield it.
If there is no local code to upload, yield None. Otherwise, yield a Code object pointing to the code.
"""
with super()._try_build_local_code() as code:
dag_updated = False
if isinstance(code, Code):
flow_dir = Path(code.path)
_, flow_dag = load_flow_dag(flow_path=flow_dir)
original_flow_dag = copy.deepcopy(flow_dag)
if self._get_all_additional_includes_configs():
# Remove additional include in the flow yaml.
dag_updated = self._remove_additional_includes(flow_dag)
# promptflow snapshot has specific ignore logic, like it should ignore `.run` by default
code._ignore_file = PromptflowIgnoreFile(flow_dir)
# promptflow snapshot will always be uploaded to default storage
code.datastore = DEFAULT_STORAGE
dag_updated = self._resolve_requirements(flow_dir, flow_dag) or dag_updated
# generate .promptflow/flow.json for csharp flow as it's required to infer signature for csharp flow
flow_directory, flow_file = resolve_flow_path(code.path)
# TODO: pass in init_kwargs to support csharp class init flex flow
> ProxyFactory().create_inspector_proxy(self.language).prepare_metadata(
flow_file=flow_directory / flow_file, working_dir=flow_directory
)
E AttributeError: 'PythonInspectorProxy' object has no attribute 'prepare_metadata'
promptflow/azure/_entities/_flow.py:168: AttributeError