Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature misalignment of Directory.with_new_file and Container.with_new_file #6961

Open
skycaptain opened this issue Mar 28, 2024 · 2 comments · May be fixed by #7293
Open

Signature misalignment of Directory.with_new_file and Container.with_new_file #6961

skycaptain opened this issue Mar 28, 2024 · 2 comments · May be fixed by #7293
Assignees

Comments

@skycaptain
Copy link
Contributor

What is the issue?

In the Python SDK, the signatures of Directory.with_new_file and Container.with_new_file are inconsistent. For Directory, contents is a required positional argument, while for Container, contents is a keyword-only argument. This inconsistency is confusing and often requires referencing the API documentation to determine the correct usage. I vote for setting up a PR, if you could give me a hint on the preferred behaviour.

Dagger version

dagger v0.10.2 (registry.dagger.io/engine) darwin/arm64

Steps to reproduce

No response

Log output

No response

Copy link
Contributor

Yeah, that's a good point. I think the Directory version, with contents being a required argument is preferred, but it's not a Python change, it's a core API change.

Copy link
Contributor

Just to explain the reason why, we've changed Directory but not Container, because of:

@helderco helderco added the breaking change Breaking Change label Apr 12, 2024 — with Linear
@helderco helderco self-assigned this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants