Skip to content

Commit

Permalink
Demote some log messages to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Jul 3, 2024
1 parent 9be2895 commit c1e5ba7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pyinaturalist_convert/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def create_table(model, db_path: PathOrStr = DB_PATH):
engine = _get_engine(db_path)
table = model.__tablename__
if inspect(engine).has_table(table):
logger.info(f'Table {table} already exists')
logger.debug(f'Table {table} already exists')
else:
model.__table__.create(engine)
logger.info(f'Table {table} created')
logger.debug(f'Table {table} created')


def create_tables(db_path: PathOrStr = DB_PATH):
Expand Down
9 changes: 4 additions & 5 deletions pyinaturalist_convert/dwca.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,26 +195,25 @@ def _cleanup_observations(db_path: PathOrStr = DB_PATH):
"""Run the following post-processing steps after loading observations:
* Translate dwc:informationWithheld into standard geoprivacy values
* Translate captive values into True/False
* Vacuum/analyze
"""
spinner = get_progress_spinner('Post-processing')
with spinner, sqlite3.connect(db_path) as conn:
logger.info('Finding observations with open geoprivacy')
logger.debug('Finding observations with open geoprivacy')
conn.execute("UPDATE observation SET geoprivacy='open' " 'WHERE geoprivacy IS NULL')

logger.info('Finding observations with obscured geoprivacy')
logger.debug('Finding observations with obscured geoprivacy')
conn.execute(
"UPDATE observation SET geoprivacy='obscured' "
"WHERE geoprivacy LIKE 'Coordinate uncertainty increased%'"
)

logger.info('Finding observations with private geoprivacy')
logger.debug('Finding observations with private geoprivacy')
conn.execute(
"UPDATE observation SET geoprivacy='private' "
"WHERE geoprivacy LIKE 'Coordinates hidden%'"
)

logger.info('Formatting captive/wild status')
logger.debug('Formatting captive/wild status')
conn.execute("UPDATE observation SET captive=FALSE WHERE captive='wild'")
conn.execute('UPDATE observation SET captive=TRUE WHERE captive IS NOT FALSE')

Expand Down

0 comments on commit c1e5ba7

Please sign in to comment.