Skip to main content

Prefect Supporter

Project description

prefect_supporter

prefect_supporter provide services to supporter to manage Prefect

Usage

  1. Delete flow run history in Database. It also deletes task 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
        )
      
  • 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

prefect_supporter-1.0.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

prefect_supporter-1.0.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file prefect_supporter-1.0.2.tar.gz.

File metadata

  • Download URL: prefect_supporter-1.0.2.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.1.0

File hashes

Hashes for prefect_supporter-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d06a9978626de587862b8a91aecd2c66292962b64034d6cb0e6a5fff54e8641a
MD5 0ad4f22c6ac9ed1a942acd99320e7b46
BLAKE2b-256 fe68e6e9b8a16832f259a66ba734d017d4cb2db4322b3b6a64bf5844079cdfc2

See more details on using hashes here.

File details

Details for the file prefect_supporter-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for prefect_supporter-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 01d299d3e472f32960598d095d6ab8c8776f63014eaa28578398c95a70006e0d
MD5 679c5b07b7a46f62595f5658268bb602
BLAKE2b-256 e3347ec8943c17b9ba2b1d40305644006b5f6e9ba8384bf5315273d3ea497baf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page