PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
15.33k stars 1.5k forks source link

RunnerDeployment.from_storage strips file-extension like pattern from deployment name #14026

Open peterbygrave opened 2 weeks ago

peterbygrave commented 2 weeks ago

First check

Bug summary

RunnerDeployment.from_storage performs Path(name).stem on deployment name regardless of whether it is a path or not.

For example we use a version string for our deployment names like v1.2.3. This will be transformed by Path(name).stem to v1.2.

This can be reproduced following the example: https://docs.prefect.io/latest/guides/prefect-deploy/?h=def+deploy#store-your-code-in-git-based-cloud-storage

and changing name="no-image-deployment", to name="no-image-deployment.hello", will create a deployment name no-image-deployment

Reproduction

# Adapted from https://docs.prefect.io/latest/guides/prefect-deploy/?h=def+deploy#store-your-code-in-git-based-cloud-storage

from prefect import get_client, flow

if __name__ == "__main__":
    flow.from_source(
        "https://github.com/my_github_account/my_repo/my_file.git",
        entrypoint="flows/no-image.py:hello_world",
    ).deploy(
        name="no-image-deployment.hello",
        work_pool_name="my_pool",
        build=False
    )

Error

No response

Versions

v2

Additional context

No response

jakekaplan commented 2 weeks ago

Hi, thanks for filing this issue! Seems reasonable that we should allow this