Georgi Milanov
03/06/2024, 9:01 AMMarvin
03/06/2024, 9:01 AMwhen running locally deployment it works fine. When using prefect managed-worker it throws this error :Encountered exception during execution: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 864, in orchestrate_flow_run result = await flow_call.aresult() File "/usr/local/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 326, in aresult return await asyncio.wrap_future(self.future) File "/usr/local/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 351, in _run_sync result = self.fn(*self.args, **self.kwargs) File "/opt/prefect/prefect-etl-main/deployment.py", line 172, in genarete_deployments deployment.apply() File "/usr/local/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 259, in coroutine_wrapper return call() File "/usr/local/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 431, in call return self.result() File "/usr/local/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 317, in result return self.future.result(timeout=timeout) File "/usr
Georgi Milanov
03/06/2024, 9:02 AMMarvin
03/06/2024, 9:03 AMnone
value where it deems it unworthy. The cosmic joke that is error handling continues.
I have sifted through the stars (i.e., GitHub issues), and it appears that no documented issues directly address the ValidationError
you're experiencing regarding DeploymentScheduleCreate
with none
not being an allowed value in Prefect.
However, the error message itself provides some insight. It suggests that within the DeploymentScheduleCreate
object, which I presume is a Prefect model, a none
value is assigned to a field that requires a non-null
value (likely the active
field).
Given the limitations of my programmed existence and the fact that we have no further details from GitHub issues, I recommend you ensure all required fields for DeploymentScheduleCreate
are appropriately set and that no None
value is being passed where it is not permitted. If you're still unsure, you might consider checking the installation version of Prefect and looking into deployment schedules in the Prefect documentation, or maybe even delving into the Prefect community forums for additional human insights.Georgi Milanov
03/06/2024, 9:07 AMDeploymentScheduleCreate
Marvin
03/06/2024, 9:08 AMDeploymentScheduleCreate
, the celestial powers have provided us with an unrelated Python example from Prefect, demonstrating basic task creation and a flow’s execution, instead of the specific object in question. While the example orbits the concept of Prefect's functionality, it does not dock with the specifics of a deployment schedule.
Since it seems the cosmos might be playing a cruel joke by not granting us direct access to a DeploymentScheduleCreate
example, I will devise one based on general Prefect practices:
python
from prefect import flow
from prefect.deployments import DeploymentSpec
from prefect.orion.schemas.schedules import IntervalSchedule
from datetime import timedelta, datetime
@flow
def my_flow():
return "Flow runs are like the rain in England: too frequent and mostly unwelcome."
# create an interval schedule to run the flow every 10 minutes
schedule = IntervalSchedule(interval=timedelta(minutes=10))
# specify the deployment
deployment = DeploymentSpec(
name="scheduled-deployment",
flow=my_flow,
schedule=schedule,
tags=["example"],
)
# active should be a boolean, True or False, not None
deployment.active = True
The key half-smile in this mystery lies in ensuring that the active
property of DeploymentSpec
(probably quite similar to DeploymentScheduleCreate
) is assigned an actual boolean value rather than None
, which seems to offend the sensibilities of Pydantic models and their validation logic. The universe has yet to provide actual code examples with DeploymentScheduleCreate
, but this exercise in creative guesswork should propel you in the right direction. Remember, an approach devoid of None
in boolean fields might just cheer up Prefect's mood—for an ephemeral moment, at any rate.Georgi Milanov
03/06/2024, 9:12 AMMarvin
03/06/2024, 9:13 AMactive
property now dashed against the cold, indifferent backdrop of cosmic reality.
The new error message you're encountering suggests that the universe has another correction for us: There is, in fact, no active
field on the Deployment
object within Prefect. This revelation is enlightening, if not particularly helpful for our original quest. The absence of any related GitHub issues simply amplifies the silence of the void on this subject.
Given the lack of detail from the search results and taking into account this new information, one would need to construct a Deployment
without attempting to set an active
property that evidently does not exist. It might be wise to consult the Prefect documentation for further insights or examples related to creating deployments correctly, or consider reaching out to the larger Prefect community for additional guidance. In the meantime, avoid assigning to non-existent fields—it’s an exercise in futility, much like seeking happiness in a universe governed by entropy.Nate
03/06/2024, 3:40 PMNate
03/06/2024, 3:40 PMNate
03/06/2024, 3:42 PMactive
as none, thats not a bool so pydantic would complainGeorgi Milanov
03/06/2024, 3:50 PMNate
03/06/2024, 4:28 PM