Guilherme Petris
05/13/2022, 11:35 AMAnna Geller
prefect diagnostics
?Guilherme Petris
05/13/2022, 11:46 AM❯ prefect diagnostics
{
"config_overrides": {
"context": {
"secrets": false
}
},
"env_vars": [],
"system_information": {
"platform": "macOS-12.3.1-x86_64-i386-64bit",
"prefect_backend": "cloud",
"prefect_version": "1.2.1",
"python_version": "3.9.10"
}
}
import pandas as pd
from zdesk import Zendesk
from prefect.client.secrets import Secret
import prefect
from prefect import task, Flow
import pyarrow as pa
import datetime
from modules.snowflake_utils import SnowflakeBaseTask
from prefect.executors import LocalDaskExecutor
from prefect.run_configs import LocalRun
from prefect.storage import Local
sn = SnowflakeBaseTask()
# Credentials and connections
zpass = Secret('ZDESK_PASSWORD').get()
zendesk = Zendesk(
zdesk_email = X
zdesk_url = Y,
zdesk_password = zpass,
zdesk_token= True)
#INCREMENTAL CALL TICKETS
@task
def latest_date():
latest_date = sn._find_latest_date(
schema='ZENDESK',
table='TICKETS',
date_column='updated_at')
return print(latest_date)
with Flow("Zendesk_incremental_test",
run_config = LocalRun(working_dir="/Users/guilherme.petris/Scrive/python_scripts"),
storage=Local(),
executor=LocalDaskExecutor()
) as flow:
latest_date()
flow.register("zendesk_project_test")
Anna Geller
prefect agent local start -p /Users/guilherme.petris/Scrive/python_scripts
and then register this flow using CLI:
prefect register --project xxx -p your_flow.py
this will use local storage as default, will attach your hostname as a label, and this way match with your local agentGuilherme Petris
05/13/2022, 12:07 PM-p your_flow.py
shouldn’t be the path?Anna Geller
Guilherme Petris
05/13/2022, 12:39 PMAnna Geller