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

add example code for s3 io manager #11

Merged
merged 2 commits into from
Aug 16, 2022

Conversation

yuhan
Copy link
Contributor

@yuhan yuhan commented Aug 10, 2022

includes example code to set up s3 io manager and vary prefix per branch (commented by default)
brings back the second asset

@yuhan
Copy link
Contributor Author

yuhan commented Aug 10, 2022

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions
Copy link

github-actions bot commented Aug 10, 2022

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
example_location Deploy failed Aug 16, 2022 at 11:13 PM (UTC)

@yuhan yuhan requested review from benpankow and sryza August 10, 2022 23:05
my_dagster_project/repository.py Outdated Show resolved Hide resolved

from my_dagster_project import assets


@repository
def my_dagster_project():

# # To take advantage of Dagster's incremental re-execution functionality (e.g. retry from failure),
Copy link

Choose a reason for hiding this comment

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

I think talking about re-execution is a little confusing here, because users will be able to re-execute the asset if it fails. They just won't be able to define a downstream asset that depends on this one.

Copy link

Choose a reason for hiding this comment

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

Separately, why two levels of comment indentation 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.

users will be able to re-execute the asset if it fails. They just won't be able to define a downstream asset that depends on this one.

that was why we say "incremental re-execution" here. added " When you define a downstream asset that depends on another asset, ..."

Separately, why two levels of comment indentation here?

because it differentiate the comment from code and users can uncomment the entire block -- i wonder if using triple quoted comments instead would make sense.

# # In this example, we vary folder per branch deployment (PR number) and prod.
# # Read about best practice at https://docs.dagster.io/guides/dagster/branch_deployments
# if os.getenv("DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT"):
# s3_prefix = f"MY_S3_PREFIX/branch_{os.getenv('DAGSTER_CLOUD_PULL_REQUEST_ID')}"
Copy link

Choose a reason for hiding this comment

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

is it typical to capitalize S3 paths? if not, I think this should be lowercase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the intent was to let the user replace the prefix with their own values - but guess that part was unclear. updated comments

my_dagster_project/repository.py Outdated Show resolved Hide resolved
# # To take advantage of Dagster's incremental re-execution functionality (e.g. retry from failure),
# # you'll need to set up an IO manager that can move the data across runs.
# # Learn more at https://docs.dagster.io/concepts/io-management/io-managers#applying-io-managers-to-assets
# # NOTE: Uncomment the example code below to use an s3_pickle_io_manager to pass data between runs.
Copy link

Choose a reason for hiding this comment

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

A little confusing here that there's no code directly below this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reformatted the comment - hope this is more clear

my_dagster_project/repository.py Outdated Show resolved Hide resolved
@yuhan yuhan mentioned this pull request Aug 15, 2022
@yuhan yuhan requested a review from sryza August 16, 2022 06:39
Copy link

@sryza sryza left a comment

Choose a reason for hiding this comment

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

Nice

@yuhan yuhan merged commit cfdbb96 into main Aug 16, 2022
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