Skip to content

Fix hacks in project commands and sync - #5353

Merged
helderco merged 1 commit into
dagger:mainfrom
helderco:projects/python/codegen-fix
Jun 23, 2023
Merged

helderco merged 1 commit into
dagger:mainfrom
helderco:projects/python/codegen-fix

Conversation

@helderco

Copy link
Copy Markdown
Contributor

Follow up to #5300 to fix a hack.

@helderco
helderco requested a review from sipsma June 22, 2023 15:58
@helderco
helderco force-pushed the projects/python/codegen-fix branch from eae5b0d to 26ba5d3 Compare June 22, 2023 15:58
@helderco
helderco force-pushed the projects/python/codegen-fix branch from 26ba5d3 to 2f28172 Compare June 22, 2023 19:37
@helderco
helderco marked this pull request as ready for review June 22, 2023 19:37

@sipsma sipsma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One non-blocking comment/question, looks great!

def _from_context(cls, ctx: Context):
return cls(replace(ctx, selections=deque()))

def _get_object_instance(self, id_: str | Scalar, cls: type[_Type]) -> _Type:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I'll have to add this in Go too 👍

# id type as the Query field argument.
#
# Example:
# `Query.directory(id: DirectoryID): Directory` matches

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I'm 100% understanding all this, but I think there might be a corner case for certain types like CacheVolume where the arg name is key instead of id:

def cache_volume(self, key: str) -> CacheVolume:

Doesn't matter right now because we don't support cache volumes as inputs or return types yet, just an FYI as I guess that might come up in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly. I kicked that can later for when we cross that bridge.

@helderco
helderco merged commit f799e77 into dagger:main Jun 23, 2023
@helderco
helderco deleted the projects/python/codegen-fix branch June 26, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants