Skip to content

Commit

Permalink
Merge pull request #312 from smart-on-fhir/mg/generator-warning
Browse files Browse the repository at this point in the history
Disable context generator cleanup pylint warning
  • Loading branch information
mikix authored May 16, 2024
2 parents ed8dc5b + 570c7ef commit a322b54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cumulus_etl/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,14 @@ def write_json(path: str, data: Any, indent: int = None) -> None:


@contextlib.contextmanager
# pylint: disable-next = contextmanager-generator-missing-cleanup
def read_csv(path: str) -> csv.DictReader:
# Python docs say to use newline="", to support quoted multi-line fields
with _atomic_open(path, "r", newline="") as csvfile:
yield csv.DictReader(csvfile)


# pylint: disable-next = contextmanager-generator-missing-cleanup
def read_ndjson(path: str) -> Iterator[dict]:
"""Yields parsed json from the input ndjson file, line-by-line."""
with _atomic_open(path, "r") as f:
Expand Down
1 change: 1 addition & 0 deletions cumulus_etl/loaders/i2b2/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from cumulus_etl.loaders.i2b2.schema import ObservationFact, PatientDimension, VisitDimension


# pylint: disable-next = contextmanager-generator-missing-cleanup
def extract_csv(path_csv: str) -> Iterator[dict]:
"""
:param path_csv: /path/to/i2b2_formatted_file.csv
Expand Down

0 comments on commit a322b54

Please sign in to comment.