Skip to content

Commit

Permalink
FIX: Only load initial snapshot folders from the archive bucket(#24)
Browse files Browse the repository at this point in the history
ODS-QLIK table loading for EDW.PATRON_TRIP is currently not functional.

This is because the latest initial snapshot folder (based on timestamp) is currently located in the data-platform error bucket. While the snapshot folder that the cubic qlik process is populating is in the archive bucket.

Having the ods-qlik loader only look for snapshot files in the archive bucket will fix this issue for the EDW.PATRON_TRIP table. However, if an initial snapshot folder is moved to the error bucket, and remains in-use by the cubic ods-qlik process, then this functionality will again be broken.
  • Loading branch information
rymarczy authored Oct 1, 2024
1 parent d1c4015 commit 6602431
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cubic_loader/qlik/ods_qlik.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ def status_schema_to_df(status: TableStatus) -> pl.DataFrame:


def get_snapshot_dfms(table: str) -> List[DFMDetails]:
"""find all available snapshot dfm files for a qlik table from Archive and Error buckets"""
"""find all available snapshot dfm files for a qlik table from Archive bucket"""
prefix = os.path.join(QLIK, f"{table}/")
archive_dfms = s3_list_objects(S3_ARCHIVE, prefix, in_filter=".dfm")
error_dfms = s3_list_objects(S3_ERROR, prefix, in_filter=".dfm")

found_snapshots = []
for dfm in archive_dfms + error_dfms:
for dfm in archive_dfms:
found_snapshots.append(DFMDetails(path=dfm, ts=re_get_first(dfm, RE_SNAPSHOT_TS)))

assert len(found_snapshots) > 0
Expand Down

0 comments on commit 6602431

Please sign in to comment.