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

Make injectors take no params and move tempdir handling to body of inject_context #16354

Merged
merged 6 commits into from
Sep 12, 2023

Conversation

schrockn
Copy link
Member

@schrockn schrockn commented Sep 7, 2023

Summary & Motivation

We want to restructure the ext clients so that they receive the context injector arguments as __init__ time, rather than as a parameter to run. However right now in some cases (namely the file case) the context injector has to be constructed when the temp directory is already created. This moves the temp dir creation logic into the inject_context method itself. This makes the __init__ trivial. The downside is that we create two tempdirs, one for the message reader and one for the context injector. However that in my judgement is immateriai

How I Tested These Changes

BK

@schrockn
Copy link
Member Author

schrockn commented Sep 7, 2023

@schrockn schrockn changed the title Make Injector a factory object that produces an injection Make injectors take no params and move tempdir handling to body of inject_context Sep 7, 2023
@schrockn schrockn marked this pull request as ready for review September 7, 2023 01:33
Base automatically changed from make-clients-POPO-2 to master September 7, 2023 16:35
Copy link
Member

@alangenfeld alangenfeld left a comment

Choose a reason for hiding this comment

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

I think is is resolved via ExtTempFile___ classes now unless i am missing something

self review part 2

add old descs to docblocks

Make Injector a factory object that produces an injection

move all to

cleanup

reduce overengineering

undo rename

fix tests

fix test again

whoopsie
@github-actions
Copy link

Deploy preview for dagster-university ready!

✅ Preview
https://dagster-university-44ug9qptj-elementl.vercel.app
https://make-clients-POPO-3.dagster-university.dagster-docs.io

Built with commit 043dcda.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-qbhjm6r46-elementl.vercel.app
https://make-clients-POPO-3.core-storybook.dagster-docs.io

Built with commit 043dcda.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-hff5qbv92-elementl.vercel.app
https://make-clients-POPO-3.components-storybook.dagster-docs.io

Built with commit 043dcda.
This pull request is being automatically deployed with vercel-action

@@ -196,7 +206,7 @@ def build_pod_body(
"name": pod_name,
}
if "labels" in meta:
meta["labels"] = {**get_common_labels(), **meta["labels"]}
meta["labels"] = {**get_common_labels(), **meta["labels"]} # type: ignore
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Member Author

Choose a reason for hiding this comment

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

it was barking at me in vscode. maybe I have pyright misconfigured?

Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2023-09-12 at 4 01 57 PM

Copy link
Member

Choose a reason for hiding this comment

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

do whatever works, just wanted to make sure it was intentional

@schrockn schrockn merged commit bf2540e into master Sep 12, 2023
1 check failed
@schrockn schrockn deleted the make-clients-POPO-3 branch September 12, 2023 20:19
schrockn added a commit that referenced this pull request Sep 12, 2023
## Summary & Motivation

Similar to #16354, change the message reader class so it can be
instantiated at client construction time, rather than requiring a
temporary directory already exist. This ends up simplifying some code
paths that had to account the readers could be created on demand.
Instead all these codepaths not assume a single reader instance is
passed in and always there.

## How I Tested These Changes

BK
zyd14 pushed a commit to zyd14/dagster that referenced this pull request Sep 15, 2023
…ject_context (dagster-io#16354)

## Summary & Motivation

We want to restructure the ext clients so that they receive the context
injector arguments as `__init__` time, rather than as a parameter to
run. However right now in some cases (namely the file case) the context
injector has to be constructed when the temp directory is already
created. This moves the temp dir creation logic into the
`inject_context` method itself. This makes the `__init__` trivial. The
downside is that we create two tempdirs, one for the message reader and
one for the context injector. However that in my judgement is immateriai

## How I Tested These Changes

BK
zyd14 pushed a commit to zyd14/dagster that referenced this pull request Sep 15, 2023
## Summary & Motivation

Similar to dagster-io#16354, change the message reader class so it can be
instantiated at client construction time, rather than requiring a
temporary directory already exist. This ends up simplifying some code
paths that had to account the readers could be created on demand.
Instead all these codepaths not assume a single reader instance is
passed in and always there.

## How I Tested These Changes

BK
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