Skip to content

Commit

Permalink
Replace prints with logging
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Bulat <obulat@gmail.com>
  • Loading branch information
obulat committed Mar 13, 2024
1 parent 6a909c1 commit bea0cbb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions catalog/utilities/media_props_gen/db.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import re
from dataclasses import dataclass
from pathlib import Path
Expand Down Expand Up @@ -43,11 +44,15 @@ def create_db_props_dict(
table_description_matches = CREATE_TABLE_REGEX.search(contents)

if not table_description_matches:
print(f"Could not find table description for {media_type} in {sql_path}")
logging.warning(
f"Could not find table description for {media_type} in {sql_path}"
)
return {}
table_name = table_description_matches.group(1)
if table_name != media_type:
print(f"Table name {table_name} does not match media type {media_type}")
logging.warning(
f"Table name {table_name} does not match media type {media_type}"
)
return {}
field_descriptions = [
field.strip()
Expand Down

0 comments on commit bea0cbb

Please sign in to comment.