Skip to content

Clean sdk dependency from core #7681

Clean sdk dependency from core

Clean sdk dependency from core #7681

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

1 fail, 16 skipped, 442 pass in 42m 49s

    4 files      4 suites   42m 49s ⏱️
  459 tests   442 ✅ 16 💤 1 ❌
1 836 runs  1 768 ✅ 64 💤 4 ❌

Results for commit 003a3f2.

Annotations

Check warning on line 0 in tests.sdk_cli_test.unittests.test_flow_invoker.TestFlowInvoker

See this annotation in the file changed.

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

All 4 runs failed: test_flow_invoker_unsupported_connection_provider (tests.sdk_cli_test.unittests.test_flow_invoker.TestFlowInvoker)

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: 'NoneType' object has no attribute 'get'
self = <sdk_cli_test.unittests.test_flow_invoker.TestFlowInvoker object at 0x7fa7069f2130>

    def test_flow_invoker_unsupported_connection_provider(self):
        with pytest.raises(UnsupportedConnectionProvider):
            FlowInvoker(flow=EXAMPLE_FLOW, connection_provider=[])
    
        with pytest.raises(UserErrorException):
>           FlowInvoker(
                flow=EXAMPLE_FLOW,
                connection_provider="unsupported",
            )

tests/sdk_cli_test/unittests/test_flow_invoker.py:29: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
promptflow/core/_serving/flow_invoker.py:72: in __init__
    self._init_connections(connection_provider)
promptflow/core/_serving/flow_invoker.py:110: in _init_connections
    connections = self.resolve_connections(
promptflow/core/_serving/flow_invoker.py:99: in resolve_connections
    raise e
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <promptflow.core._serving.flow_invoker.FlowInvoker object at 0x7fa6e834b1f0>
connection_names = {'azure_open_ai_connection'}, provider = None

    def resolve_connections(
        self,
        connection_names,
        provider,
        *,
        raise_error=False,
        connections_to_ignore=None,
        connections_to_add=None,
    ):
        """Resolve connections required by flow, get connections from provider."""
        connection_names = set(connection_names)
        if connections_to_add:
            connection_names.update(connections_to_add)
        result = {}
        for name in connection_names:
            if connections_to_ignore and name in connections_to_ignore:
                continue
            try:
>               conn = provider.get(name=name)
E               AttributeError: 'NoneType' object has no attribute 'get'

promptflow/core/_serving/flow_invoker.py:95: AttributeError