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

[docs] remove I/O managers from SDA page (DOC-108) #19269

Merged
merged 6 commits into from
Feb 26, 2024

Conversation

jamiedemaria
Copy link
Contributor

@jamiedemaria jamiedemaria commented Jan 17, 2024

Summary & Motivation

Updates the SDA page to remove references to I/O managers

Outstanding questions/todos:

  • What to do about the testing section? need to come up with how we will recommend unit testing when the asset function could be writing to a real storage location
  • This PR removes all mentions of I/O managers. Do we want to fully remove them like that, or keep some of the examples, but have them be relegated to an "advanced/additional functionality" status?

How I Tested These Changes

@jamiedemaria
Copy link
Contributor Author

jamiedemaria commented Jan 17, 2024

@@ -168,15 +111,6 @@ def my_derived_asset():
return execute_query("SELECT * from a_source_asset").as_list() + [4]
```

You can also define a dependency on a `SourceAsset` that will load the data of the asset:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should probably get moved to the I/O manager concept page

@@ -271,31 +205,6 @@ def context_asset(context: AssetExecutionContext):
...
```

### Conditional materialization
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be replaced with a section discussion conditional yielding of MaterializeResult (assuming that that is the "conditional materialization" equivalent in no-io world)

Copy link
Contributor

Choose a reason for hiding this comment

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

Will this still be valid if someone does elect to use an I/O manager? Should this be deleted entirely, or just moved elsewhere and re-written here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes. This section should get moved to the I/O manager concept page.

I need to do a little testing to ensure i fully understand the syntax for indicating a conditional materialization when not using I/O managers, and then I can write the replacement section

Copy link
Contributor Author

@jamiedemaria jamiedemaria Feb 8, 2024

Choose a reason for hiding this comment

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

hmmm the API to do this without I/O managers isn't great....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#15418

Either way, I think the section as written right now should be moved to the I/O manager concept page. And then we can either:

  1. be done. Decide that the API ergonomics need to be fixed before publicly documenting this use case for non I/O managed assets
  2. write a replacement section for non I/O managed assets that uses the less-than-great APIs

I'll think a bit on what my opinion is for which option we take, but if you have a rule of thumb for this type of situation in the docs, I will follow that!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can punt on that so it doesn't hold up this PR.

I don't have a hard and fast rule for handling this kind of thing in the docs. I tend to take into account how often users would ask about something when deciding whether to include a less-than-ideal approach to something in the docs, especially if we're going to change it soon.

Perhaps we could throw the non-ideal workaround in a discussion (which IMO a 'less official' set of content) until the ergonomics are addressed? It could be something like "We plan on improving this thing, but for now, here's how you can do it"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the discussion approach! i'll merge this and then write that up

@@ -593,26 +490,6 @@ def test_uses_context():

---

## Loading asset values outside of Dagster runs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be moved to the I/O manager page

@@ -665,9 +542,6 @@ def table1() -> Output[None]:
return Output(None, metadata={"num_rows": 25})
```

#### Recording materialization metadata using I/O managers
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be moved to I/O manager concept page

@jamiedemaria jamiedemaria marked this pull request as ready for review February 2, 2024 16:56
@erinkcochran87
Copy link
Contributor

@jamiedemaria it looks like the SDA page was reverted (or at least it's not showing up in the changed files atm) - is this still the PR I should be looking at?

@jamiedemaria
Copy link
Contributor Author

it looks like the SDA page was reverted

i have no idea how that happened ughhhhh. i'll see if i can find it in the change history

@jamiedemaria
Copy link
Contributor Author

@erinkcochran87 I got the page back, so this is reviewable now!

Copy link
Contributor

@erinkcochran87 erinkcochran87 left a comment

Choose a reason for hiding this comment

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

Left a few comments!

For the section's you've marked as "move to I/O concept page," how d'you want to handle this? I have a PR open already for updating that page, so I could add + re-org them on my branch.

@@ -271,31 +205,6 @@ def context_asset(context: AssetExecutionContext):
...
```

### Conditional materialization
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this still be valid if someone does elect to use an I/O manager? Should this be deleted entirely, or just moved elsewhere and re-written here?

docs/content/concepts/assets/software-defined-assets.mdx Outdated Show resolved Hide resolved
@jamiedemaria
Copy link
Contributor Author

For the section's you've marked as "move to I/O concept page," how d'you want to handle this?

I think it depends a bit on how much we want to make I/O managers not exist on this page. I was envisioning that a new user reading this page would finish and have no idea what I/O managers are or how to do any of the things that opt you in to using I/O managers (most relevant for this page, that's having defining dependencies using parameters). In that case, I think the right thing to do would be to move them to the I/O manager concept page, and kind of frame it like "If you use I/O managers, now you can define dependencies like this to have the I/O manager load the value".

@erinkcochran87
Copy link
Contributor

I think that's spot-on. @jamiedemaria

@erinkcochran87 erinkcochran87 changed the title [docs] remove I/O managers from SDA page [docs] remove I/O managers from SDA page (DOC-108) Feb 15, 2024
@jamiedemaria jamiedemaria force-pushed the jamie/io-docs/assets branch 2 times, most recently from ab8d1fd to d5089a2 Compare February 22, 2024 19:50
@jamiedemaria jamiedemaria force-pushed the jamie/io-docs/assets branch 2 times, most recently from 6101a88 to 4d28536 Compare February 23, 2024 20:11
Copy link
Contributor

@erinkcochran87 erinkcochran87 left a comment

Choose a reason for hiding this comment

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

🎉

Base automatically changed from jamie/io-docs/tutorial to master February 23, 2024 20:34
@jamiedemaria jamiedemaria force-pushed the jamie/io-docs/assets branch 2 times, most recently from f9233ee to 762325a Compare February 26, 2024 15:48
@jamiedemaria jamiedemaria merged commit 628c691 into master Feb 26, 2024
1 of 2 checks passed
@jamiedemaria jamiedemaria deleted the jamie/io-docs/assets branch February 26, 2024 17:07
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