Cormac
03/04/2024, 2:54 PMquery = f"SELECT * FROM `{table}`"
print(f"Starting DB fetch")
with conn_obj.get_engine().connect() as connection:
print(f"Got DB connection")
with connection.execution_options(yield_per=yield_per).execute(query) as result:
print("Ran DB Query")
print(f"sending block partition")
time.sleep(1)
for block in result:
p_in.send(block)
...
fails with error
AttributeError: __enter__
This type of error suggests that context manager is not supported - but it it is if SQLAlchemy is version 2.
But my pip freeze
reports prefect-sqlalchemy==0.3.2
Can someone please assist?
1. What version of SQLAlchemy is prefect-sqlalchemy built over?
2. How do I do server-side cursors with Prefect SQLAlchemy?Nate
03/04/2024, 3:42 PMCormac
03/04/2024, 3:43 PMNate
03/04/2024, 3:45 PM