Skip to content

Commit

Permalink
remove logging every item in batch writer
Browse files Browse the repository at this point in the history
  • Loading branch information
torimcd committed Oct 30, 2024
1 parent e4b6a84 commit 3bda9c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 4 additions & 0 deletions hydrocron/db/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,12 @@ def load_data(dynamo_resource, table_name, items):
logging.info("Item %s: %s", feature_id, items[i][feature_id])
hydrocron_table.batch_fill_table(items)

logging.info("Finished loading %s items", len(items))

else:
logging.info("Adding %s items to table individually", feature_name)
for item_attrs in items:
logging.info("Item %s: %s", feature_id, item_attrs[feature_id])
hydrocron_table.add_data(**item_attrs)

logging.info("Finished loading %s items", len(items))
5 changes: 0 additions & 5 deletions hydrocron/db/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ def batch_fill_table(self, items):
try:
with table.batch_writer() as writer:
for item in items:
logger.info(
"Item %s size: %s",
item[self.partition_key_name],
str(sys.getsizeof(item))
)
if sys.getsizeof(item) < 300000:
writer.put_item(Item=item)
else:
Expand Down

0 comments on commit 3bda9c0

Please sign in to comment.