Skip to content

Separate promptflow-core package #8376

Separate promptflow-core package

Separate promptflow-core package #8376

GitHub Actions / SDK CLI Test Result [brynn/separate-promptflow-core](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-test.yml?query=branch:brynn/separate-promptflow-core++) failed Mar 27, 2024 in 0s

1 fail, 17 skipped, 444 pass in 41m 58s

    4 files  ±0      4 suites  ±0   41m 58s ⏱️ -1s
  462 tests ±0    444 ✅ ±0  17 💤 ±0  1 ❌ ±0 
1 848 runs  ±0  1 776 ✅ ±0  68 💤 ±0  4 ❌ ±0 

Results for commit bb93ab6. ± Comparison against earlier commit a6dfcdc.

Annotations

Check warning on line 0 in tests.sdk_cli_test.e2etests.test_flow_as_func.TestFlowAsFunc

See this annotation in the file changed.

@github-actions github-actions / SDK CLI Test Result [brynn/separate-promptflow-core](https://github.com/microsoft/promptflow/actions/workflows/promptflow-sdk-cli-test.yml?query=branch:brynn/separate-promptflow-core++)

All 4 runs failed: test_flow_with_default_variant (tests.sdk_cli_test.e2etests.test_flow_as_func.TestFlowAsFunc)

artifacts/Test Results (Python 3.10) (OS ubuntu-latest)/test-results-sdk-cli.xml [took 0s]
artifacts/Test Results (Python 3.11) (OS ubuntu-latest)/test-results-sdk-cli.xml [took 0s]
artifacts/Test Results (Python 3.8) (OS ubuntu-latest)/test-results-sdk-cli.xml [took 0s]
artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results-sdk-cli.xml [took 0s]
Raw output
AttributeError: 'AzureOpenAIConnection' object has no attribute '_to_dict'
self = <sdk_cli_test.e2etests.test_flow_as_func.TestFlowAsFunc object at 0x7f91e0926fd0>
azure_open_ai_connection = <promptflow.core._connection.AzureOpenAIConnection object at 0x7f91a8c3cbb0>

    def test_flow_with_default_variant(self, azure_open_ai_connection):
        f = load_flow(f"{FLOWS_DIR}/web_classification_default_variant_no_llm_type")
        f.context = FlowContext(
            connections={
                "summarize_text_content": {"connection": azure_open_ai_connection},
            }
        )
        # function can successfully run with connection override
>       f(url="https://www.youtube.com/watch?v=o5ZQyXaAv1g")

tests/sdk_cli_test/e2etests/test_flow_as_func.py:328: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
promptflow/_sdk/entities/_flow/base.py:239: in __call__
    result = self.invoke(inputs=kwargs)
promptflow/_sdk/entities/_flow/dag.py:155: in invoke
    return super().invoke(inputs=inputs)
promptflow/_sdk/entities/_flow/base.py:246: in invoke
    invoker = FlowContextResolver.resolve(flow=self)
promptflow/_sdk/entities/_flow/base.py:223: in __hash__
    return hash(self.context) ^ self._content_hash
promptflow/_sdk/entities/_flow/base.py:79: in __hash__
    self._resolve_connections()
promptflow/_sdk/entities/_flow/base.py:53: in _resolve_connections
    name = self._get_connection_obj_name(conn)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'promptflow._sdk.entities._flow.base.FlowContext'>
connection = <promptflow.core._connection.AzureOpenAIConnection object at 0x7f91a8c3cbb0>

    @classmethod
    def _get_connection_obj_name(cls, connection):
        # create a unique connection name for connection obj
        # will generate same name if connection has same content
>       connection_dict = connection._to_dict()
E       AttributeError: 'AzureOpenAIConnection' object has no attribute '_to_dict'

promptflow/_sdk/entities/_flow/base.py:61: AttributeError