# Census Tasks
Verified by Prefect
This module contains a task for starting and monitoring Census sync jobs
# CensusSyncTask
Task for running Census connector sync jobs.
This task assumes the user has a Census sync already configured and is attempting to orchestrate the sync using Prefect task to send a post to the API within a prefect flow. Copy and paste from the api trigger section on the configuration page in the api_trigger
param to set a default sync.
Args:
api_trigger (str, optional)
: Default sync to trigger, if none is specified inrun
. The API trigger URL for a sync can be found on sync's configuration page (https://app.getcensus.com/syncs/{sync_id}/configuration) under Sync Triggers > API.**kwargs (dict, optional)
: Additional kwargs to pass to the base Task constructor.
api_trigger
stored in a Prefect secret: from prefect import Flow
from prefect.tasks.census import CensusSyncTask
from prefect.tasks.secrets import PrefectSecret
sync_census = CensusSyncTask()
with Flow("Run Census Sync") as flow:
api_trigger = PrefectSecret('CENSUS_API_TRIGGER')
results = sync_census(api_trigger=api_trigger)
methods: |
---|
prefect.tasks.census.census.CensusSyncTask.check_invalid_api (api_trigger)[source] |
Makes sure the URL for the API trigger matches the Census format specified below. If it does not, it will raise a ValueError.
|
prefect.tasks.census.census.CensusSyncTask.run (api_trigger, poll_status_every_n_seconds=60)[source] |
Task run method for Census syncs.
|
This documentation was auto-generated from commit bd9182e
on July 31, 2024 at 18:02 UTC