mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-28 12:31:18 -07:00
User Story 2152 – Clean up logging (#2155)
Update logging messages and message consistency This update includes changes to the level of many log messages. Rather than everything being logged at the info level, it differentiates between debug, info, warning, and error messages. It also changes the default log level to info to avoid much of the noise previously in the logs. It also removes many extra log messages, and adds additional decorators at the beginning of each pipeline run.
This commit is contained in:
parent
7cfb56476e
commit
03a6d3c660
63 changed files with 307 additions and 339 deletions
|
@ -23,7 +23,7 @@ def toy_score_df(scope="module"):
|
|||
|
||||
|
||||
def _helper_test_dropping_tracts(toy_score_df, drop_tracts):
|
||||
logger.info(drop_tracts)
|
||||
logger.debug(drop_tracts)
|
||||
test_frame = toy_score_df[
|
||||
~toy_score_df[field_names.GEOID_TRACT_FIELD].isin(drop_tracts)
|
||||
]
|
||||
|
|
|
@ -41,12 +41,10 @@ class ExampleETL(ExtractTransformLoad):
|
|||
/ "input.zip"
|
||||
)
|
||||
|
||||
logger.info(f"Extracting {zip_file_path}")
|
||||
with zipfile.ZipFile(zip_file_path, "r") as zip_ref:
|
||||
zip_ref.extractall(self.get_tmp_path())
|
||||
|
||||
def transform(self):
|
||||
logger.info(f"Loading file from {self.get_tmp_path() / 'input.csv'}.")
|
||||
df: pd.DataFrame = pd.read_csv(
|
||||
self.get_tmp_path() / "input.csv",
|
||||
dtype={self.GEOID_TRACT_FIELD_NAME: "string"},
|
||||
|
|
|
@ -202,7 +202,7 @@ class TestETL:
|
|||
|
||||
expected_file_path = data_path / "dataset" / etl.NAME / "usa.csv"
|
||||
|
||||
logger.info(f"Expected: {expected_file_path}")
|
||||
logger.debug(f"Expected: {expected_file_path}")
|
||||
|
||||
assert actual_file_path == expected_file_path
|
||||
|
||||
|
@ -545,7 +545,7 @@ class TestETL:
|
|||
# Delete output file.
|
||||
output_file_path = etl._get_output_file_path()
|
||||
if os.path.exists(output_file_path):
|
||||
logger.info("Deleting output file created by other tests.")
|
||||
logger.debug("Deleting output file created by other tests.")
|
||||
os.remove(output_file_path)
|
||||
|
||||
# Run more steps to generate test data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue