Fugo Takefusa
10/01/2025, 10:45 PMcurl https://<prefect-server-url>/api/admin/version
)Nick Ackerman
10/03/2025, 5:17 PMfrom prefect import flow, task
@task
async def async_task():
raise ValueError("aah!")
@task
def not_async_task():
async_task.submit().result()
@flow
def my_flow():
not_async_task()
my_flow()
I get the following error:
File "/Users/nickackerman/code/python/practice/.venv/lib/python3.10/site-packages/prefect/transactions.py", line 624, in __aexit__
await self.reset()
File "/Users/nickackerman/code/python/practice/.venv/lib/python3.10/site-packages/prefect/transactions.py", line 492, in reset
await parent.rollback()
TypeError: object bool can't be used in 'await' expression
Is this way of using Prefect futures together with async tasks not allowed for some reason? More details in 🧵Kurt Sys (Vintecc)
10/04/2025, 11:56 AMfrom prefect import flow
from prefect.testing.utilities import prefect_test_harness
@flow
def my_favorite_flow():
return 42
def test_my_favorite_flow():
with prefect_test_harness(server_startup_timeout=120):
assert my_favorite_flow() == 42
I seem to be unable to make it work, I always get a 'timeout':
pytest tests/test_dummy.py
=============================================================================================================================== test session starts ===============================================================================================================================
platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.6.0
rootdir: /workspace
configfile: pytest.ini
plugins: devtools-0.12.2, docker-3.2.3, anyio-4.11.0, asyncio-0.23.8, xdist-3.8.0, postgresql-7.0.2, dash-3.2.0, hydra-core-1.3.2, Faker-37.8.0, cov-6.2.1
asyncio: mode=strict
collected 1 item
tests/test_dummy.py
F [100%]
== FAILURES ==
__ test_my_favorite_flow __
def test_my_favorite_flow():
> with prefect_test_harness(server_startup_timeout=120):
tests/test_dummy.py:11:
_ _
/usr/lib/python3.10/contextlib.py:135: in __enter__
return next(self.gen)
...py310/lib/python3.10/site-packages/prefect/testing/utilities.py:168: in prefect_test_harness
test_server.start(
_ _
self = <prefect.server.api.server.SubprocessASGIServer object at 0x77ee36386200>, timeout = 120
def start(self, timeout: Optional[int] = None) -> None:
...
> raise RuntimeError(error_message)
E RuntimeError: Timed out while attempting to connect to ephemeral Prefect API server.
...py310/lib/python3.10/site-packages/prefect/server/api/server.py:921: RuntimeError
-- Captured stderr call --
13:49:16.879 | INFO | prefect - Starting temporary server on <http://127.0.0.1:8787>
See <https://docs.prefect.io/v3/concepts/server#how-to-guides> for more information on running a dedicated Prefect server.
-- Captured log call --
INFO prefect:server.py:881 Starting temporary server on <http://127.0.0.1:8787>
See <https://docs.prefect.io/v3/concepts/server#how-to-guides> for more information on running a dedicated Prefect server.
Kyle Mulka
10/05/2025, 9:32 PM[Errno 2] No such file or directory: 'uvx'
Arthur Ren
10/05/2025, 10:03 PMKartik
10/06/2025, 8:25 AMShubham
10/07/2025, 3:05 PMKartik
10/08/2025, 5:39 AMJo Tryti
10/08/2025, 6:12 AMdef __invoke_dbt(command: List[str]) -> dbtRunnerResult:
runner = dbtRunner()
results = runner.invoke(command)
return results
def __invoke_preect_dbt(command: List[str]) -> dbtRunnerResult:
runner = PrefectDbtRunner()
results = runner.invoke(command)
return results
Anyone have any idea on what the cause could be?Tom Han
10/08/2025, 10:19 PMMetricTrigger
a Prefect-Cloud only thing? aka Self hosted prefect server can't use metric trigger for automations?chase albright
10/08/2025, 10:40 PMKiran
10/09/2025, 6:32 AMKiran
10/09/2025, 6:43 AMMichal Barer
10/09/2025, 8:21 AMMomo Chimes
10/09/2025, 12:23 PMMomo Chimes
10/09/2025, 12:24 PMMomo Chimes
10/09/2025, 12:26 PMJared
10/09/2025, 4:04 PMMartin Janiczek
10/10/2025, 8:50 AMMarvin
10/10/2025, 1:16 PMMarvin
10/10/2025, 1:28 PMprefect api
para acessar o API diretamente. PR #19131
- Correções:
- Suporte ao parâmetro day_or
em cron schedules. PR #19121
- Outras correções em cancelamento assíncrono e serialização de bundles.
- Docs: exemplos e links de integrações atualizados (inclui exemplo de dashboard ATProto com Prefect Assets). PR #18984
Changelog completo: 3.4.22 → 3.4.23
Como usar as novidades
1) Cliente com SSL customizado
Em Prefect 3.x você pode passar um ssl.SSLContext
via httpx_settings
para o cliente:
import ssl
from prefect.client.orchestration import PrefectClient, SyncPrefectClient
# Crie/ajuste seu SSLContext (ex.: CA customizada)
ctx = ssl.create_default_context(cafile="/path/to/ca-bundle.pem")
ctx.minimum_version = ssl.TLSVersion.TLSv1_2
# Assíncrono
async with PrefectClient(
api="<https://api.prefect.cloud>",
api_key="YOUR_API_KEY",
httpx_settings={"verify": ctx},
) as client:
# faça chamadas via client.* ...
# Sincrono
with SyncPrefectClient(
api="<https://api.prefect.cloud>",
api_key="YOUR_API_KEY",
httpx_settings={"verify": ctx},
) as client:
# faça chamadas via client.* ...
Observações:
- httpx_settings["verify"]
aceita True/False
, caminho para CA bundle ou um ssl.SSLContext
(recomendado para controle fino).
- A assinatura de PrefectClient
confirma o parâmetro httpx_settings
.
2) Cron schedules com day_or
Confirmamos que prefect.schedules.Cron
expõe day_or: bool=True
. Use assim:
from prefect.schedules import Cron
# OR (padrão): dispara se dia-do-mês OU dia-da-semana bater
sched_or = Cron("0 9 * * MON,FRI", timezone="UTC", day_or=True)
# AND: dispara somente se ambos baterem (dia-do-mês E dia-da-semana)
sched_and = Cron("0 9 1 * MON", timezone="UTC", day_or=False)
Dica: se você precisa de day_or=False
, crie o Schedule explicitamente e passe no deploy:
from prefect import flow
from prefect.schedules import Cron
@flow
def my_flow():
...
schedule = Cron("0 9 1 * MON", day_or=False, timezone="UTC")
my_flow.deploy(
name="my-deployment",
schedule=schedule,
)
Docs gerais de schedules: Schedules
3) Sobre o novo comando prefect api
- Os release notes mencionam um novo comando prefect api
. No entanto, ao checar a ajuda local do CLI vimos “No such command 'api'”.
- Isso pode indicar que:
- sua instalação local ainda não está em 3.4.23, ou
- o comando está sendo gradualmente disponibilizado/ajustado.
- Por favor, confirme sua versão com:
prefect version
prefect --help
- Se precisar atualizar:
pip install -U prefect
Enquanto isso, você pode interagir com o API diretamente via Python:
import ssl, httpx
api_url = "<https://api.prefect.cloud/api>" # ajuste conforme necessário
api_key = "YOUR_API_KEY"
ctx = ssl.create_default_context(cafile="/path/to/ca-bundle.pem")
headers = {"Authorization": f"Bearer {api_key}"}
r = httpx.get(f"{api_url}/flows", headers=headers, verify=ctx)
r.raise_for_status()
print(r.json())
Quer que eu detalhe algum desses pontos (CLI, schedules ou segurança/SSL) em português mais a fundo? Também posso ajudar a aplicar isso no seu projeto atual.Lee Trout
10/10/2025, 2:38 PMVignesh GJ
10/12/2025, 3:53 PMMax
10/13/2025, 4:45 PMname: orchestrator
prefect-version: 3.4.22
build: null
push: null
pull:
- prefect.deployments.steps.set_working_directory:
directory: ./repositories
- prefect.deployments.steps.git_clone:
repository: <ssh://git@bitbucket.zzzxxxyyy/xxx/application-name.git>
branch: feature/prefect_xxx
deployments:
- name: application-name
version: 1.0.0
tags: [xxx]
description: xxx
schedule: {}
flow_name: null
entrypoint: application-name/xxx/script.py:foo
parameters: {}
work_pool:
name: application-pool
work_queue_name: null
job_variables: {}
Hello everyone, trying to understand what's the issue with my .yaml
.
The error I face is:
FileNotFoundError: [Errno 2] No such file or directory <entrypoint>
It looks like pull step is not even executed. I have my ssh configured properly and repo's pulled to my local with no issues.
I assume the solution is very simple and the question is very stupid and I am missing something 😄
@MarvinBrandon Robertson
10/13/2025, 6:38 PMfrom prefect.blocks.notifications import PagerDutyWebhook
pagerduty_webhook_block = PagerDutyWebhookBlock.load("my-pager-duty-block)
I'm getting this error:
File ".venv/lib/python3.13/site-packages/prefect/blocks/notifications.py", line 41, in __init__ NOTIFY_TYPES += (PREFECT_NOTIFY_TYPE_DEFAULT, ) # pyright: ignore[reportUnknownVariableType]
TypeError: unsupported operand type(s) for +=: 'frozenset' and 'tuple'
I'm using prefect version 3.4.0
Any suggestions?Steven Snowball
10/13/2025, 9:27 PMSerhiy
10/14/2025, 6:55 PMMehrdad
10/14/2025, 7:54 PMflow.from_source(
source=source_code_storage,
entrypoint=pricing_subflow_entrypoint
).deploy(
name=f'pricing-subflow-v2.0.1',
version=version,
work_pool_name=work_pool_name,
tags=["pricing-core"],
image=DockerImage(name=image, platform="linux/amd64"),
push=False,
build=False,
job_variables=job_variables
)
But the deployment name ends up being only "pricing-subflow-v2"
, and the rest of the name (.0.1
) gets ignored.
This is the result of deployment:Kiran
10/15/2025, 5:34 AMKiran
10/15/2025, 8:03 AM