镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Missing 'deprecated' dependency #1030

Description

@ronyis

Describe the bug

Importing msgraph_core.requests.batch_request_content fails with ModuleNotFoundError: No module named 'deprecated'

Expected behavior

Import should work (without manually installing 'deprecated' package)

How to reproduce

  1. pip install msgraph-core
  2. import msgraph_core.requests.batch_request_content

SDK Version

1.3.8

Latest version known to work for scenario above?

No response

Known Workarounds

Installing deprecated package

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Activity

  1. Nothing4You commented on Nov 28, 2025

    @Nothing4You

    The actual root cause is here:

    this was originally introduced in #821 with 83863f7 and included in v1.2.1.

  2. rgant commented on Aug 9, 2026

    @rgant

    Still reproduces on msgraph-core 1.5.1. Fresh isolated environment, nothing else installed:

    $ uv run --isolated --with msgraph-core==1.5.1 python -c "import msgraph_core.requests.batch_request_content"
    ModuleNotFoundError: No module named 'deprecated'

    The practical impact is that the SDK's own batch API is unreachable out of the box. BatchRequestContent, BatchRequestBuilder and BatchResponseContent all sit behind that import, so a caller who wants $batch either installs an undeclared dependency or hand-rolls the request against the raw endpoint. The hand-rolled path loses BatchResponseContent.get_response_status_codes(), which is the only convenient way to catch a per-request failure inside a 200 response.

    Confirming the scope of the dependency, in case it helps close this: deprecated is imported in exactly two modules, and each uses it for one decorator.

    src/msgraph_core/requests/batch_request_item.py:11   from deprecated import deprecated
    src/msgraph_core/requests/batch_request_item.py:18   @deprecated("Use BytesIO type instead")
    src/msgraph_core/requests/batch_response_item.py:4   from deprecated import deprecated
    src/msgraph_core/requests/batch_response_item.py:13  @deprecated("Use BytesIO type instead")
    

    Both decorate a StreamInterface(BytesIO) subclass. So the fix is either to declare Deprecated as a runtime dependency, or to drop the package and mark StreamInterface with a DeprecationWarning from the standard library, which removes a runtime dependency added for two decorators.

  3. rgant commented on Sep 28, 2026

    @rgant

    It seems like this ticket has fallen through the cracks. I don't see anyone from Microsoft assigned, so apologies for the random pings. Gavin Barron (@gavinbarron), Dan Fiedler (@danfiedler-msft), Jingjing Jia (@jingjingjia-ms)

    This is causing real problems and the fix is relatively small in my estimation. Can someone look into this as it has been a problem for more than a year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions