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

[DS][36/n] Create ScheduledSince condition #21712

Merged
merged 1 commit into from
May 14, 2024

Conversation

OwenKephart
Copy link
Contributor

@OwenKephart OwenKephart commented May 7, 2024

Summary & Motivation

Creates a condition which determines if an asset partition has been requested within some lookback period.

It does this by keeping track of a set of (essentially) tuples of (AssetSlice, last_requested_timestamp). These tuples are evicted from the list whenever they age out of the lookback window.

It uses asset_subsets_with_metadata instead of the more generic extra_state field because asset_subsets_with_metadata get rendered in the UI. this means that users will be able to see exactly when an asset partition was last requested (if it was requested within the given lookback period).

How I Tested These Changes

@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from 77c8447 to bcdc712 Compare May 7, 2024 23:56
Copy link
Contributor Author

OwenKephart commented May 7, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @OwenKephart and the rest of your teammates on Graphite Graphite

@OwenKephart OwenKephart force-pushed the 05-07-Create_ChildCondition_condition branch from 594d77c to 88dce77 Compare May 8, 2024 23:01
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from bcdc712 to d6b9e0e Compare May 8, 2024 23:01
@OwenKephart OwenKephart force-pushed the 05-07-Create_ChildCondition_condition branch from 88dce77 to bde7a62 Compare May 8, 2024 23:08
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from d6b9e0e to 0d35118 Compare May 8, 2024 23:08
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from 0fd4a9d to 1bbbd9a Compare May 9, 2024 23:21
@OwenKephart OwenKephart changed the base branch from 05-07-Create_ChildCondition_condition to 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata May 10, 2024 22:14
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from 1bbbd9a to 3174f9a Compare May 10, 2024 22:14
@OwenKephart OwenKephart force-pushed the 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata branch from 4946a2f to eb565e8 Compare May 10, 2024 22:44
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from 3174f9a to 6dae5df Compare May 10, 2024 22:44
@OwenKephart OwenKephart changed the title [DS][35/n] Create ScheduledSince condition [DS][36/n] Create ScheduledSince condition May 10, 2024
@OwenKephart OwenKephart requested a review from schrockn May 10, 2024 22:46
@OwenKephart OwenKephart force-pushed the 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata branch from eb565e8 to b9a986c Compare May 13, 2024 17:30
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from 6dae5df to c9aee95 Compare May 13, 2024 17:30
@OwenKephart OwenKephart force-pushed the 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata branch from b9a986c to 97839e1 Compare May 13, 2024 17:54
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from c9aee95 to 8ede4ae Compare May 13, 2024 17:54
Copy link
Member

@schrockn schrockn left a comment

Choose a reason for hiding this comment

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

Awesome. Let some comments about a yet-to-be written abstraction in this layer, but we can write that later and change these callsites.

Comment on lines +65 to +70
slices_with_metadata = [
AssetSliceWithMetadata(
asset_slice.compute_difference(context.previous_requested_slice), metadata
)
for asset_slice, metadata in previous_slices_with_metadata
]
Copy link
Member

Choose a reason for hiding this comment

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

This definitely speaks to me to the the need of a generalized abstraction encapsulate a set of slices with metadata we can operate. I was calling this a "space" in early prototypes which wasn't quire right

but

space.difference_with(context.previous_requested_slice)

would be very nice.

Comment on lines +85 to +98
return [
asset_slice_with_metadata
for asset_slice_with_metadata in slices_with_metadata
if not (
asset_slice_with_metadata.asset_slice.is_empty
or cast(
float,
asset_slice_with_metadata.metadata.get(
_REQUEST_TIMESTAMP_METADATA_KEY, MetadataValue.float(0)
).value,
)
< self._get_minimum_timestamp(context)
)
]
Copy link
Member

Choose a reason for hiding this comment

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

Similarly here this feels like it should be a primitive on a slightly higher level of abstraction.

@OwenKephart OwenKephart force-pushed the 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata branch from 97839e1 to fc4c2a0 Compare May 14, 2024 13:48
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from 8ede4ae to 5823a56 Compare May 14, 2024 13:48
@OwenKephart OwenKephart force-pushed the 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata branch from fc4c2a0 to a5d3f72 Compare May 14, 2024 13:56
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from 5823a56 to e704541 Compare May 14, 2024 13:56
@OwenKephart OwenKephart force-pushed the 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata branch from a5d3f72 to 407cd58 Compare May 14, 2024 13:59
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from e704541 to 91e489e Compare May 14, 2024 13:59
@OwenKephart OwenKephart force-pushed the 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata branch from 407cd58 to b6d8453 Compare May 14, 2024 14:14
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from 91e489e to bd76584 Compare May 14, 2024 14:14
Copy link
Contributor Author

OwenKephart commented May 14, 2024

Merge activity

  • May 14, 10:38 AM EDT: @OwenKephart started a stack merge that includes this pull request via Graphite.
  • May 14, 11:06 AM EDT: Graphite rebased this pull request as part of a merge.
  • May 14, 11:07 AM EDT: @OwenKephart merged this pull request with Graphite.

@OwenKephart OwenKephart force-pushed the 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata branch from b6d8453 to e374d83 Compare May 14, 2024 15:02
Base automatically changed from 05-10-Replace_asset_subsets_with_metadata_with_asset_slices_with_metadata to master May 14, 2024 15:04
@OwenKephart OwenKephart force-pushed the 05-07-Create_RecentlyRequested_condition branch from bd76584 to 55b9187 Compare May 14, 2024 15:05
@OwenKephart OwenKephart merged commit 407e2c5 into master May 14, 2024
1 check failed
@OwenKephart OwenKephart deleted the 05-07-Create_RecentlyRequested_condition branch May 14, 2024 15:07
danielgafni pushed a commit to danielgafni/dagster that referenced this pull request Jun 18, 2024
## Summary & Motivation

Creates a condition which determines if an asset partition has been requested within some lookback period.

It does this by keeping track of a set of (essentially) tuples of (AssetSlice, last_requested_timestamp). These tuples are evicted from the list whenever they age out of the lookback window.

It uses asset_subsets_with_metadata instead of the more generic extra_state field because asset_subsets_with_metadata get rendered in the UI. this means that users will be able to see exactly when an asset partition was last requested (if it was requested within the given lookback period).

## How I Tested These Changes
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.

None yet

2 participants