Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLAlchemy Transaction error #1583

Closed
waltcow opened this issue Nov 21, 2023 · 3 comments
Closed

SQLAlchemy Transaction error #1583

waltcow opened this issue Nov 21, 2023 · 3 comments
Labels
🐞 bug Something isn't working

Comments

@waltcow
Copy link
Contributor

waltcow commented Nov 21, 2023

Dify version

0.3.21

Cloud or Self Hosted

Self Hosted

Steps to reproduce

psycopg2.InterfaceError: cursor already closed

        with db.engine.begin() as conn:
            rs = conn.execute(db.text(sql_query), arg_dict)

        response_data = []

        for i in rs:
            response_data.append({
                'date': str(i.date),
                'interactions': float(i.interactions.quantize(Decimal('0.01')))
            })

        return jsonify({
            'data': response_data
        })

(https://github.com/langgenius/dify/blob/cc35d0645a862c7eea28ff34b044ba8ebf29ff6e/api/controllers/console/app/statistic.py#L259C1-L272C11)

image

✔️ Expected Behavior

no error

❌ Actual Behavior

sql error

@waltcow waltcow added the 🐞 bug Something isn't working label Nov 21, 2023
@takatost
Copy link
Collaborator

Can you please make a PR if possible? I would be extremely grateful!

@waltcow
Copy link
Contributor Author

waltcow commented Nov 21, 2023

Okay

@waltcow
Copy link
Contributor Author

waltcow commented Nov 21, 2023

Can you please make a PR if possible? I would be extremely grateful!

#1586

@waltcow waltcow closed this as completed Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants