Denormalized Code not Passing on GitHub but Passes on Lambda Server.
Closed this issue · 1 comments
echen4628 commented
Did anyone run into an issue with github actions for the normalized case? My code seems to pass all the tests on the lambda server, but when i commit to github, I'm getting the following error.
twitter_postgres_pg_normalized_1
load normalized
2024-04-05 00:49:09.393231 test-data.zip
Traceback (most recent call last):
File "/home/runner/work/twitter_postgres/twitter_postgres/load_tweets.py", line 461, in <module>
insert_tweet(connection,tweet)
File "/home/runner/work/twitter_postgres/twitter_postgres/load_tweets.py", line 106, in insert_tweet
with connection.begin() as trans:
File "/home/runner/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 868, in begin
raise exc.InvalidRequestError(
sqlalchemy.exc.InvalidRequestError: This connection has already initialized a SQLAlchemy Transaction() object via begin() or autobegin; can't call begin() here unless rollback() or commit() is called first.
(The denormalized case passes on github actions). Thanks!
epaisano commented
Take a look at the pinned issue! It explains how to solve that problem.