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

Resolve SQL Lock Issues in df_to_psql Function #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

er-or-er
Copy link

@er-or-er er-or-er commented Jun 3, 2024

I encountered issues with SQL locks (observed in pgAdmin) that were preventing the model from completing its run. The locks were occurring specifically in the df_to_psql function within input_data_functions.py. After reviewing the SQLAlchemy documentation, I found that using a "begin once" block could help mitigate this issue. Specifically, I referred to the documentation here.

To address the problem, I made the following change:

  • Added with conn.begin: to the SQL loop in the df_to_psql function within input_data_functions.py.

This change ensures that each transaction is properly managed within the df_to_psql function, which has resolved the SQL lock issues in my tests. The model now completes its run without encountering lock-related interruptions.

Thank you for reviewing this request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant