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

Revert "add test that returns cursored asset records for run (#21700)" #21790

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4109,57 +4109,6 @@ def observe_asset():
asset_entry = storage.get_asset_records([asset_key])[0].asset_entry
assert asset_entry.last_observation_record == fetched_record

def test_get_cursored_asset_records_for_run(
self,
storage: EventLogStorage,
instance: DagsterInstance,
):
@op
def materialize_asset():
yield AssetMaterialization("a")
yield AssetMaterialization("b")
yield AssetMaterialization("c")
yield AssetMaterialization("d")
yield AssetMaterialization("e")
yield Output(5)

with instance_for_test() as created_instance:
if not storage.has_instance:
storage.register_instance(created_instance)

run_id = make_new_run_id()
with create_and_delete_test_runs(instance, [run_id]):
events, result = _synthesize_events(
lambda: materialize_asset(), instance=created_instance, run_id=run_id
)
for event in events:
storage.store_event(event)

# get the materialization from the one_asset_job run
def _get_record_storage_ids(cursor=None, limit=None, ascending=True):
return [
record.storage_id
for record in storage.get_records_for_run(
run_id,
of_type=DagsterEventType.ASSET_MATERIALIZATION,
cursor=cursor,
limit=limit,
ascending=ascending,
).records
]

storage_ids = _get_record_storage_ids()
assert len(storage_ids) == 5
assert storage_ids[0] < storage_ids[4]
[a, b, c, d, e] = storage_ids

assert _get_record_storage_ids(
cursor=EventLogCursor.from_storage_id(c).to_string(), limit=2, ascending=True
) == [d, e]
assert _get_record_storage_ids(
cursor=EventLogCursor.from_storage_id(c).to_string(), limit=2, ascending=False
) == [b, a]

def test_last_run_id_updates_on_materialization_planned(
self,
storage: EventLogStorage,
Expand Down