Prefect Supporter
Project description
prefect_supporter
prefect_supporter provide services to supporter to manage Prefect
Usage
- Delete
flow run
history 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
FlowRunClearing
model- 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
File details
Details for the file prefect_supporter-1.0.3.tar.gz
.
File metadata
- Download URL: prefect_supporter-1.0.3.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 | 7c7b0cecfc127009c2c517b2f8de84cfdafd1ac41b2b6b3d8e61390f2c400e0c |
|
MD5 | 5b53178a98294ad3d4946191af9f36b4 |
|
BLAKE2b-256 | 1d5464ad748d82103948f91f866c61630e5fab214028c752393fcd030fe979a5 |
File details
Details for the file prefect_supporter-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: prefect_supporter-1.0.3-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 | 271e1183c7eb1c3198ef04891833bcf42a88b12f23eb9e4e844954bbb48ed00a |
|
MD5 | d2856e59906adb8f6b57c586960e6e0f |
|
BLAKE2b-256 | d032694a2115e3862f32a25fe6322d601f775def6529fe04f147d6109f4e1153 |