用途:Prefect 用于把 Python 函数转为可观测、可调度的数据工作流,适合 ETL、批处理、定时报表等数据管道场景。
主要能力:通过 @flow、@task 装饰器添加重试(retries、retry_delay_seconds)、日志(get_run_logger)、缓存(cache_expiration、cache_key_fn)、超时(timeout_seconds);支持任务并发提交(.submit 与 .result)、异步流程、子流程及错误处理。提供本地 Prefect 服务端(UI + API)与 Prefect Cloud 托管模式。
使用方式:安装 pip install prefect;本地启动 prefect server start,UI 位于 http://localhost:4200,或使用 prefect cloud login。可通过 daily_report.serve(cron=...) 以 Python 创建部署,或用 CLI:prefect deploy、prefect worker start、prefect deployment run。Block 用于可复用配置与密钥(如 Secret、JSON、SqlAlchemyConnector)。CLI 还可执行 prefect version、prefect flow-run ls、prefect deployment ls、prefect flow-run logs 等。
适用场景:需要重试、缓存、日志与监控的 Python 数据管道;定时与并发任务;需要密钥或数据库连接等配置管理的流程。
限制:资料未提供性能与规模上限、许可与收费细节、具体平台兼容范围及版本要求,这些暂未提供。