Skip to content

Commit

Permalink
fix case when there are no followup jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Nov 6, 2024
1 parent a1ad07a commit 62d0055
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dlt/destinations/impl/filesystem/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,16 +726,17 @@ def create_table_chain_completed_followup_jobs(
for job in completed_table_chain_jobs
if job.job_file_info.table_name == table["name"]
]
files_per_job = self.config.delta_jobs_per_write or len(table_job_paths)
for i in range(0, len(table_job_paths), files_per_job):
jobs_chunk = table_job_paths[i : i + files_per_job]
file_name = FileStorage.get_file_name_from_file_path(jobs_chunk[0])
jobs.append(ReferenceFollowupJobRequest(file_name, jobs_chunk))
if len(table_job_paths) == 0:
# file_name = ParsedLoadJobFileName(table["name"], "empty", 0, "reference").file_name()
# TODO: if we implement removal od orphaned rows, we may need to propagate such job without files
# to the delta load job
pass
else:
files_per_job = self.config.delta_jobs_per_write or len(table_job_paths)
for i in range(0, len(table_job_paths), files_per_job):
jobs_chunk = table_job_paths[i : i + files_per_job]
file_name = FileStorage.get_file_name_from_file_path(jobs_chunk[0])
jobs.append(ReferenceFollowupJobRequest(file_name, jobs_chunk))

return jobs

Expand Down

0 comments on commit 62d0055

Please sign in to comment.