What’s up prefects - I have a pretty simple task `...
# ask-community
s
What’s up prefects - I have a pretty simple task
Copy code
@prefect.task()
def get_backfill_or_scheduled_date():
    time = prefect.context.get("backfill_time") or prefect.context.get("scheduled_start_time")
    print(time)
    print(type(time))
However I see that this task creates a pod in kubernetes with the image
prefecthq/prefect:0.15.12
, is there a way that I can specify the python version for this image? The mismatch between the build and run environment is causing an error
The error that I see is
Copy code
Failed to load and execute Flow's environment: FlowStorageError("An error occurred while unpickling the flow:\n  TypeError('code() takes at most 15 arguments (16 given)')\nThis may be due to one of the following version mismatches between the flow build and execution environments:\n  - python: (flow built with '3.8.12', currently running with '3.7.12')")
And I’ve confirmed the prefect version is 0.15.12 in both places
k
Hi @Samay Kapadia, it shouldn’t be this task that is defining the image. Are you using
KubernetesRun
in your Flow?
s
Yes! I think that should solve it. Thanks 🙂
k
You can specify the image there.
KubernetesRun(image="prefecthq/prefect:latest-python3.8")
s
Thanks!