Skip to content

Commit 8b2feda

Browse files
Merge pull request #86 from CDCgov/rr-85-fail-fast
Rr 85 fail fast
2 parents 15004aa + 8dff7f8 commit 8b2feda

6 files changed

Lines changed: 22 additions & 2 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Read the [Dataset Developer Guide](docs/data_developer_guide.md) for information
4141
## Project admins
4242

4343
- Thomas Hladish <utx5@cdc.gov> (CDC/OD/ORR/CFA)
44-
- Phillip Rogers <ap66@cdc.gov> (CDC/OD/ORR/CFA)(CTR)
4544
- Ryan Raasch <xng3@cdc.gov> (CDC/OD/ORR/CFA)(CTR)
4645

4746
---

cfa/dataops/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
except ImportError:
1313
__version__ = "unknown"
1414

15+
from .catalog import datacat, reportcat
16+
1517
__all__ = ["__version__", "datacat", "reportcat"]
1618

1719

cfa/dataops/catalog.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
walk_blobs_in_container,
2121
write_blob_stream,
2222
)
23+
from cfa.cloudops.util import check_ext_env
2324

2425
from .config_validator import (
2526
ConfigValidator,
@@ -266,6 +267,8 @@ def get_versions(self) -> list:
266267
list: sorted list of data version paths in descending order
267268
(latest first)
268269
"""
270+
if not check_ext_env():
271+
raise RuntimeError("No EXT access configured.")
269272
glob_path = f"{self.prefix}/"
270273
return sorted(
271274
[
@@ -321,6 +324,9 @@ def _get_version_blobs(
321324
Raises:
322325
ValueError: If the requested version cannot be resolved.
323326
"""
327+
# check credential access
328+
if not check_ext_env():
329+
raise RuntimeError("No EXT access configured.")
324330
if not self.is_ledger:
325331
available_versions = self.get_versions()
326332
version = version_matcher(
@@ -454,6 +460,8 @@ def get_dataframe(
454460
Returns:
455461
pd.DataFrame | pl.DataFrame | pl.LazyFrame: the dataframe
456462
"""
463+
if not check_ext_env():
464+
raise RuntimeError("No EXT access configured.")
457465
if output not in ["pandas", "polars", "pd", "pl", "pl_lazy", "lazy"]:
458466
raise ValueError(
459467
f"Output {output} needs to be 'pandas', 'polars', 'pd', 'pl', 'pl_lazy', or 'lazy'."

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Calendar Versioning](https://calver.org/).
77
The versioning pattern is `YYYY.MM.DD.micro(a/b/{none if release})
88

99
---
10+
## [2026.05.29.1]
11+
12+
### Fixed
13+
14+
- added a check to ensure the right environment, otherwise the code fails faster
15+
1016
## [2026.05.29.0]
1117

1218
### 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 = "2026.05.29.0"
3+
version = "2026.05.29.1"
44
description = "Data cataloging, ETL, modeling, verification, and validation for CFA"
55
authors = [
66
{ name = "Phil Rogers", email = "ap66@cdc.gov" },

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def __getattr__(self, name):
2626

2727

2828
def _install_test_stubs() -> None:
29+
_ensure_module(
30+
"cfa.cloudops.util",
31+
check_ext_env=lambda *args, **kwargs: True,
32+
)
2933
_ensure_module(
3034
"cfa.cloudops.blob_helpers",
3135
read_blob_stream=lambda *args, **kwargs: b"",
@@ -34,6 +38,7 @@ def _install_test_stubs() -> None:
3438
)
3539
_ensure_module("cfa.cloudops")
3640
sys.modules["cfa.cloudops"].blob_helpers = sys.modules["cfa.cloudops.blob_helpers"]
41+
sys.modules["cfa.cloudops"].util = sys.modules["cfa.cloudops.util"]
3742

3843
_ensure_module(
3944
"azure.identity",

0 commit comments

Comments
 (0)