Open jggatter opened 1 year ago
Bumping
@jggatter please only post on issues if there is more information to share
This issue is stale because it has been open 30 days with no activity. To keep this issue open remove stale label or comment.
Commenting to remove stale label
Hi guys, I have a similar RecursiveError problem RecursionError: maximum recursion depth exceeded while calling a Python object
, but with SQLAlchemy parameters passed into a flow.
Same as @jggatter, I have also checked for any discussions in Pydantic repository (https://github.com/pydantic/pydantic/issues/659), but it feels to me it is a low priority or out of scope problem for them.
As the recursive calls are (possibly?) due to prefect's pydantic / fastapi dependencies, I expected that setting flow validate_parameters=False
would fix the issue. I also confirmed this behaviour is specific to flow
.
How to reproduce the RecursiveError (I am using python 3.10 + prefect 2.14.3 on a W10 machine):
"""Sandbox for creating DAGs with prefect."""
from prefect import flow
from sqlalchemy import (
Column,
Integer,
String,
)
from sqlalchemy.orm import declarative_base
Base = declarative_base()
class MockupTable(Base):
"""Equities table."""
__tablename__ = "mockup"
_id = Column("id", Integer(), primary_key=True, autoincrement=True)
first_col = Column("first_col", String(), nullable=False)
second_col = Column("second_col", String(), nullable=False)
if __name__ == "__main__":
@flow(validate_parameters=False)
def uniq(uni: Column):
print(uni.name)
uniq(MockupTable.first_col)
Changing flow
to task
I get the expected behaviour:
if __name__ == "__main__":
@task
def uniq(uni: Column):
print(uni.name)
@flow
def my_flow():
uniq(MockupTable.first_col)
my_flow() # prints "first_col"
I've decided to post in this issue as my case seems similar enough. But let me know if I should open a specific issue.
First check
Bug summary
Hello!
fastapi.encoders.jsonable_encoder
presumably to then send them to a backend for storage of metadata, etc.RecursionError: maximum recursion depth exceeded in comparison
as simple objects with cyclical references do, the AnnData fails in an unrecoverable manner withAborted (core dumped)
TypeError
on another field before encountering another cyclical reference. TheTypeError
is caught by prefect allowing the flow to start. Understandably, the AnnData maintainer prefers that I seek a solution with fastapi and prefectjsonable_encoder
Thanks! James
Reproduction
Error
Versions
Additional context
I also brought this up on Slack when I first encountered the issue. We were unable to determine a solution at that time but I appreciate the great support that Zanie offered!