Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
wrridgeway committed Jan 10, 2025
1 parent 4f1b391 commit 77a63ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion socrata/socrata_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from pyathena import connect
from pyathena.pandas.cursor import PandasCursor

logger = logging.getLogger(__name__)

# Allow python to print full length dataframes for logging
pd.set_option("display.max_rows", None)

Expand Down Expand Up @@ -129,7 +131,7 @@ def build_query(

if len(columns_not_on_socrata) > 0:
exception_message += f"\nColumns in Athena but not on Socrata: {columns_not_on_socrata}"
logging.warning(exception_message)
logger.warning(exception_message)
if len(columns_not_in_athena) > 0:
exception_message += f"\nColumns on Socrata but not in Athena: {columns_not_in_athena}"
raise Exception(exception_message)
Expand Down

0 comments on commit 77a63ad

Please sign in to comment.