Skip to content

Commit ff5557a

Browse files
authored
Merge pull request #1504 from cmu-delphi/krivard/flip-input-cache-order
[cpr] Flip order of filename and asset id
2 parents af1fee0 + 9ca21f9 commit ff5557a

File tree

1 file changed

+5
-1
lines changed
  • dsew_community_profile/delphi_dsew_community_profile

1 file changed

+5
-1
lines changed

dsew_community_profile/delphi_dsew_community_profile/pull.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,13 @@ def _parse_sheet(self, sheet):
277277

278278
def as_cached_filename(params, config):
279279
"""Formulate a filename to uniquely identify this report in the input cache."""
280+
# eg "Community Profile Report 20220128.xlsx"
281+
# but delimiters vary; don't get tripped up if they do something wacky like
282+
# Community.Profile.Report.20220128.xlsx
283+
name, _, ext = config['filename'].rpartition(".")
280284
return os.path.join(
281285
params['indicator']['input_cache'],
282-
f"{config['assetId']}--{config['filename']}"
286+
f"{name}--{config['assetId']}.{ext}"
283287
)
284288

285289
def fetch_listing(params):

0 commit comments

Comments
 (0)