I was using this deployment class code last week, ...
# prefect-community
e
I was using this deployment class code last week, haven't change anything but does not seem to work now
Copy code
code = S3.load("code-beauhurst")
k8s = KubernetesJob().load("k8s-prod")
weekly_schedule = IntervalSchedule(
    interval=timedelta(weeks=1),
    anchor_date=datetime(2023, 1, 30, 2, 00))


deployment_extract = Deployment.build_from_flow(
    flow=extract_collection,
    name="beauhurst_staging",
    version=2,
    tag=["api-to-s3"],
    work_queue_name="beauhurst",
    storage=code,
    infrastructure=k8s,
    schedule=weekly_schedule
)

if __name__ == '__main__':
    deployment_extract.apply()
r
are you applying it? - when you say not working - what do you mean?
e
Yes sorry, I was but just added that to the code above. I get this error
Copy code
Traceback (most recent call last):
  File "/Users/eddydavies/code/python-beauhurst-data/deployment.py", line 17, in <module>
    deployment_extract = Deployment.build_from_flow(
  File "/Users/eddydavies/code/python-beauhurst-data/.venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 230, in coroutine_wrapper
    return run_async_in_new_loop(async_fn, *args, **kwargs)
  File "/Users/eddydavies/code/python-beauhurst-data/.venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 181, in run_async_in_new_loop
    return anyio.run(partial(__fn, *args, **kwargs))
  File "/Users/eddydavies/code/python-beauhurst-data/.venv/lib/python3.10/site-packages/anyio/_core/_eventloop.py", line 70, in run
    return asynclib.run(func, *args, **backend_options)
  File "/Users/eddydavies/code/python-beauhurst-data/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 292, in run
    return native_run(wrapper(), debug=debug)
  File "/Users/eddydavies/.pyenv/versions/3.10.5/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/Users/eddydavies/.pyenv/versions/3.10.5/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/Users/eddydavies/code/python-beauhurst-data/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
    return await func(*args)
  File "/Users/eddydavies/code/python-beauhurst-data/.venv/lib/python3.10/site-packages/prefect/deployments.py", line 708, in build_from_flow
    deployment = cls(name=name, **kwargs)
  File "/Users/eddydavies/code/python-beauhurst-data/.venv/lib/python3.10/site-packages/prefect/_internal/compatibility/experimental.py", line 228, in __init__
    cls_init(__pydantic_self__, **data)
  File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Deployment
tag
  extra fields not permitted (type=value_error.extra)
Still deploys with prefect cli though
r
hmm perhaps tag - should be tags
e
Good catch, no idea how I accidentally change that, thanks