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

fix(ingest/gc): delete invalid dpis #11998

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Changes from 1 commit
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 @@ -277,7 +277,17 @@ def delete_dpi_from_datajobs(self, job: DataJobEntity) -> None:
assert self.ctx.graph

dpis = self.fetch_dpis(job.urn, self.config.batch_size)
dpis.sort(key=lambda x: x["created"]["time"], reverse=True)
try:
dpis.sort(key=lambda x: x["created"]["time"], reverse=True)
anshbansal marked this conversation as resolved.
Show resolved Hide resolved
except Exception as e:
# Delete all cases where created is not present
for dpi in dpis:
try:
dpi["created"]["time"]
except Exception as e:
self.delete_entity(dpi["urn"], "dataprocessInstance")
# We will try again for this job next time
return

with ThreadPoolExecutor(max_workers=self.config.max_workers) as executor:
if self.config.keep_last_n:
Expand Down
Loading