Skip to content

Commit eb381ed

Browse files
authored
Merge pull request #48 from CDCgov/ap66-file_ext_flexibility_update
Ap66-file_ext_flexibility_update
2 parents 60901e7 + 020c250 commit eb381ed

4 files changed

Lines changed: 27 additions & 19 deletions

File tree

.github/workflows/release.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,14 @@ jobs:
6363
run: |
6464
poetry install --no-root --with dev
6565
66-
- name: Build Wheel
67-
if: steps.is-release.outputs.should_continue == 'true'
68-
run: |
69-
poetry build
70-
71-
- name: Create Release
72-
if: steps.is-release.outputs.should_continue == 'true'
73-
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
run: |
76-
gh release create ${{ github.ref }} dist/* --generate-notes --latest
77-
7866
- name: Update pyproject.toml Version
7967
if: steps.is-release.outputs.should_continue == 'true'
8068
env:
8169
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8270
run: |
8371
VERSION=${{ steps.get-version.outputs.version }}
8472
85-
sed -i.bak -E "s/^version\s*=\s*\"[^\"]+\"/version = \"${VERSION}\"/" pyproject.toml
73+
sed -i.bak -E "s/^\s*version\s*=\s*\"[^\"]+\"/version = \"${VERSION}\"/" pyproject.toml
8674
8775
- name: Update Change Log
8876
if: steps.is-release.outputs.should_continue == 'true'
@@ -105,6 +93,18 @@ jobs:
10593
{ print $0 }
10694
' changelog.md > temp.md && mv temp.md changelog.md
10795
96+
- name: Build Wheel
97+
if: steps.is-release.outputs.should_continue == 'true'
98+
run: |
99+
poetry build
100+
101+
- name: Create Release
102+
if: steps.is-release.outputs.should_continue == 'true'
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
run: |
106+
gh release create ${{ github.ref }} dist/* --generate-notes --latest
107+
108108
- name: Commit Change Log and pyproject.toml Updates
109109
if: steps.is-release.outputs.should_continue == 'true'
110110
env:

cfa/dataops/catalog.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,16 +283,18 @@ def get_versions(self) -> list:
283283
reverse=True,
284284
)
285285

286-
def get_file_ext(self) -> str:
286+
def get_file_ext(self, version: str = "latest") -> str:
287287
"""returns the file extension for handy routing of read byte types for
288288
DataFrame reading
289289
290+
Args:
291+
version (str, optional): the version of the data to get.
290292
Returns:
291293
str: the file extension
292294
"""
293-
return self._get_version_blobs(print_version=False)[0]["name"].split(
294-
"."
295-
)[-1]
295+
return self._get_version_blobs(version=version, print_version=False)[
296+
0
297+
]["name"].split(".")[-1]
296298

297299
def _get_version_blobs(
298300
self, version: str = "latest", newest=True, print_version=True
@@ -413,7 +415,7 @@ def get_dataframe(
413415
f"Output {output} needs to be 'pandas', 'polars', 'pd, or 'pl'."
414416
)
415417
blobs = self.read_blobs(version, newest=newest)
416-
file_ext = self.get_file_ext()
418+
file_ext = self.get_file_ext(version=version)
417419
blob_bytes = [blob.content_as_bytes() for blob in blobs]
418420
blob_files = [BytesIO(pq) for pq in blob_bytes]
419421
if file_ext == "csv":

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ The versioning pattern is `YYYY.MM.DD.micro(a/b/{none if release})
88

99
---
1010

11+
## [2025.12.10.0a]
12+
13+
### Updated
14+
15+
- Added version matching to `BlobEndpoint.get_file_ext()` method for greater flexibility to changing file types over time.
16+
1117
## [2025.12.08.1a]
1218

1319
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cfa.dataops"
3-
version = "2025.12.08.1a"
3+
version = "2025.12.10.0a"
44
description = "Data cataloging, ETL, modeling, verification, and validation for CFA"
55
authors = [
66
{ name = "Phil Rogers", email = "ap66@cdc.gov" },

0 commit comments

Comments
 (0)