Prefect Supporter
Project description
prefect_supporter
prefect_supporter provide services to supporter to manage Prefect
Usage
- Delete
flow runhistory in Database. It also deletestask run- create your deployment
- example
from datetime import datetime, timedelta from prefect.settings import PREFECT_API_URL from prefect.deployments import Deployment from prefect.server.schemas.schedules import CronSchedule from prefect.server.schemas.states import StateType from prefect_supporter.flow import clear_db_history from prefect_supporter.flow.clear_db_history import clear_db_history_flow from prefect_supporter.model.clearing_db import FlowRunClearing Deployment.build_from_flow( flow=clear_db_history_flow, name="clear_db_history_deployment", schedule=CronSchedule(cron="0 * * * *", ), work_queue_name="default", tags=["prefect-management"], entrypoint=f"{clear_db_history.__file__}:clear_db_history_flow", parameters={ "frc": FlowRunClearing( api_url=PREFECT_API_URL.value(), state_list=[StateType.COMPLETED], before_dt=(datetime.now() - timedelta(days=7)), after_dt=datetime(year=1970, month=1, day=1, hour=0, minute=0) ) }, apply=True )
- create your deployment
- Parameter
FlowRunClearingmodel- api_url : your prefect api address, ex) http://localhost:4200/api
- state_list: state list to delete ex) "COMPLETED", "FAILED"
- before_dt : time range to delete data to be started
- after_dt : time range to delete data to be ended
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prefect_supporter-1.0.4.tar.gz.
File metadata
- Download URL: prefect_supporter-1.0.4.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.16 Darwin/23.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
477a2355c3edddc9e64abbb700c29e54a9600ec507d125f90cbce8fb420ab75e
|
|
| MD5 |
f747a53f22f070eaa9120938c0d071a6
|
|
| BLAKE2b-256 |
5d0eb1e98ef7e5ee00884ae07fc33fad6f6f4b4247fd01f5d253ef9f94beff20
|
File details
Details for the file prefect_supporter-1.0.4-py3-none-any.whl.
File metadata
- Download URL: prefect_supporter-1.0.4-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.16 Darwin/23.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29417eb746a4f58aabc5dac21b0afe5edf123164b7f998f9f23b8018289c3578
|
|
| MD5 |
9ecd3634fc50366e0ab83ec795b52464
|
|
| BLAKE2b-256 |
cc8db79e00ae833f7714987959c6c2165093bf4d65b05e2b19ab5e5d15a9ac29
|