Skip to content

Import error: cannot import name _SessionSignalEvents from flask_sqlalchemy #359

Open

Description

@UniqueElphie

I came across the import error at this line:
https://github.com/aws/aws-xray-sdk-python/blob/master/aws_xray_sdk/ext/flask_sqlalchemy/query.py#L4

Package:
flask-sqlalchemy, 3.0.0
aws-xray-sdk-python, 2.10.0

It works fine when I downgrade flask-sqlalchemy to version 2.5.1

Activity

  1. srprash commented on Oct 17, 2022

    @srprash
    Contributor

    hi @UniqueElphie
    The flask-sqlalchemy 3.0 was released with breaking changes

    The _SessionSignalEvents class have been removed in the new major version

  2. srprash commented on Oct 17, 2022

    @srprash
    Contributor

    This means that for now, the X-Ray SDK is only compatible with the Flask-SQLAlchemy version <= 2.5.1

  3. s-t-e-v-e-n-k commented on Jan 6, 2023

    @s-t-e-v-e-n-k

    To my mind, this does look easier with the new version of Flask-SQLAlchemy: https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/track-modifications/

    Is there a timeline for adding support for the new version?

  4. willarmiros commented on Jan 10, 2023

    @willarmiros
    Contributor

    Hi @s-t-e-v-e-n-k,

    We cannot share this timeline with customers, but it is on our backlog. Meanwhile, OpenTelemetry Python supports all versions of Flask and you can find docs for getting started w/ OTel & X-Ray here: https://aws-otel.github.io/docs/getting-started/python-sdk

  5. matejkloska commented on May 26, 2023

    @matejkloska

    please, any update?

  6. trend-peggy-shen commented on Nov 15, 2023

    @trend-peggy-shen

    Hello,

    I would like to inquire about the possibility of resolving an issue in the near future, as we need to upgrade Flask to version 3 or higher. Due to the dependency issues with Flask v2.x.x, the Werkzeug package is required to be below version 3. However, recent scans have identified security issues in versions of Werkzeug below 3, and our team needs to upgrade it. Therefore, I am inquiring about the likelihood of aws-xray-sdk supporting Flask_SQLAlchemy 3.x.x or higher versions.

    Thank you for your assistance.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions