Skip to content

Commit

Permalink
fix(ingest/gc): delete invalid dpis (datahub-project#11998)
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored and sleeperdeep committed Dec 17, 2024
1 parent 22989a9 commit 208902f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ 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)
dpis.sort(
key=lambda x: x["created"]["time"]
if x["created"] and x["created"]["time"]
else 0,
reverse=True,
)

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

0 comments on commit 208902f

Please sign in to comment.