Skip to content

fix: reset user agent for each requests in local pfs #10444

fix: reset user agent for each requests in local pfs

fix: reset user agent for each requests in local pfs #10444

GitHub Actions / SDK CLI Global Config Test Result [zhangxingzhi/reset-user-agent-for-each-pfs-request](https://github.com/microsoft/promptflow/actions/workflows/promptflow-global-config-test.yml?query=branch:zhangxingzhi/reset-user-agent-for-each-pfs-request++) failed Mar 12, 2024 in 0s

2 errors in 3s

2 tests  ±0   0 ✅  - 2   3s ⏱️ -43s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0   2 🔥 +2 

Results for commit 9d307e0. ± Comparison against earlier commit 668685d.

Annotations

Check failure on line 0 in tests.sdk_cli_global_config_test.e2etests.test_global_config.TestGlobalConfig

See this annotation in the file changed.

@github-actions github-actions / SDK CLI Global Config Test Result [zhangxingzhi/reset-user-agent-for-each-pfs-request](https://github.com/microsoft/promptflow/actions/workflows/promptflow-global-config-test.yml?query=branch:zhangxingzhi/reset-user-agent-for-each-pfs-request++)

test_basic_flow_bulk_run (tests.sdk_cli_global_config_test.e2etests.test_global_config.TestGlobalConfig) with error

artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
failed on setup with "AttributeError: 'PFClient' object has no attribute '_bonded_user_agent'"
@pytest.fixture
    def pf() -> PFClient:
>       return PFClient()

tests/sdk_cli_global_config_test/conftest.py:16: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <promptflow._sdk._pf_client.PFClient object at 0x7f2f09e8bc10>
kwargs = {}

    def __init__(self, **kwargs):
        logger.debug("PFClient init with kwargs: %s", kwargs)
        # when this is set, telemetry from this client will use this user agent instead of the one from OperationContext
        if isinstance(kwargs.get(BONDED_USER_AGENT_KEY), str):
            self._bonded_user_agent = kwargs[BONDED_USER_AGENT_KEY]
        self._connection_provider = kwargs.pop("connection_provider", None)
        self._config = kwargs.get("config", None) or {}
        # The credential is used as an option to override
        # DefaultAzureCredential when using workspace connection provider
        self._credential = kwargs.get("credential", None)
    
        # bonded_user_agent will be applied to all TelemetryMixin operations
>       self._runs = RunOperations(self, bonded_user_agent=self._bonded_user_agent)
E       AttributeError: 'PFClient' object has no attribute '_bonded_user_agent'

promptflow/_sdk/_pf_client.py:49: AttributeError

Check failure on line 0 in tests.sdk_cli_global_config_test.e2etests.test_global_config.TestGlobalConfig

See this annotation in the file changed.

@github-actions github-actions / SDK CLI Global Config Test Result [zhangxingzhi/reset-user-agent-for-each-pfs-request](https://github.com/microsoft/promptflow/actions/workflows/promptflow-global-config-test.yml?query=branch:zhangxingzhi/reset-user-agent-for-each-pfs-request++)

test_connection_operations (tests.sdk_cli_global_config_test.e2etests.test_global_config.TestGlobalConfig) with error

artifacts/Test Results (Python 3.9) (OS ubuntu-latest)/test-results.xml [took 0s]
Raw output
failed on setup with "AttributeError: 'PFClient' object has no attribute '_bonded_user_agent'"
@pytest.fixture
    def pf() -> PFClient:
>       return PFClient()

tests/sdk_cli_global_config_test/conftest.py:16: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <promptflow._sdk._pf_client.PFClient object at 0x7f2f09dc9bb0>
kwargs = {}

    def __init__(self, **kwargs):
        logger.debug("PFClient init with kwargs: %s", kwargs)
        # when this is set, telemetry from this client will use this user agent instead of the one from OperationContext
        if isinstance(kwargs.get(BONDED_USER_AGENT_KEY), str):
            self._bonded_user_agent = kwargs[BONDED_USER_AGENT_KEY]
        self._connection_provider = kwargs.pop("connection_provider", None)
        self._config = kwargs.get("config", None) or {}
        # The credential is used as an option to override
        # DefaultAzureCredential when using workspace connection provider
        self._credential = kwargs.get("credential", None)
    
        # bonded_user_agent will be applied to all TelemetryMixin operations
>       self._runs = RunOperations(self, bonded_user_agent=self._bonded_user_agent)
E       AttributeError: 'PFClient' object has no attribute '_bonded_user_agent'

promptflow/_sdk/_pf_client.py:49: AttributeError

Check notice on line 0 in .github

See this annotation in the file changed.

@github-actions github-actions / SDK CLI Global Config Test Result [zhangxingzhi/reset-user-agent-for-each-pfs-request](https://github.com/microsoft/promptflow/actions/workflows/promptflow-global-config-test.yml?query=branch:zhangxingzhi/reset-user-agent-for-each-pfs-request++)

2 tests found

There are 2 tests, see "Raw output" for the full list of tests.
Raw output
tests.sdk_cli_global_config_test.e2etests.test_global_config.TestGlobalConfig ‑ test_basic_flow_bulk_run
tests.sdk_cli_global_config_test.e2etests.test_global_config.TestGlobalConfig ‑ test_connection_operations