Skip to content

Conversation

@ghukill
Copy link
Contributor

@ghukill ghukill commented Aug 1, 2025

Purpose and background context

This PR is some small prep work and updates for the upcoming "real" changes. And, the addition of an S3Client class that will be used to download, upload, and delete files in S3.

How can a reviewer manually see the effects of these changes?

Nothing very exciting to see at this time!

Includes new or updated dependencies?

YES

Changes expectations for external applications?

NO

What are the relevant tickets?

@coveralls
Copy link

coveralls commented Aug 1, 2025

Pull Request Test Coverage Report for Build 16684341675

Details

  • 48 of 53 (90.57%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 96.011%

Changes Missing Coverage Covered Lines Changed/Added Lines %
timdex_dataset_api/config.py 0 5 0.0%
Totals Coverage Status
Change from base Build 16269635068: -0.03%
Covered Lines: 361
Relevant Lines: 376

💛 - Coveralls

Why these changes are being introduced:

With the addition of dataset/metadata assets in S3, we will
need to perform actions like downloading the static DB file,
uploading a new one, and deleting append deltas.

How this addresses that need:

Creates new utility class S3Client that performs these
actions.

Side effects of this change:
* None

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/TIMX-530
@ghukill ghukill force-pushed the TIMX-530-prep-work-and-s3-client branch from e6eeb72 to c212b50 Compare August 1, 2025 19:34
@ghukill ghukill marked this pull request as ready for review August 1, 2025 19:35
@ghukill ghukill requested a review from a team August 1, 2025 19:35
@jonavellecuerdo jonavellecuerdo self-requested a review August 1, 2025 19:38
Copy link
Contributor

@jonavellecuerdo jonavellecuerdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of questions before I take another pass at review!

logging.basicConfig(level=logging.DEBUG)
return configure_logger(__name__)
if not logging.getLogger().handlers:
logging.basicConfig(level=logging.WARNING)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does line 37 set the logging level to logging.WARNING only to be set to logging.DEBUG a few lines after? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 37 sets the WARNING for logging.basicConfig() which is kind of global. But then we set the actual timdex_dataset_api logger instance to DEBUG.

I'll admit, there are probably other ways to do this... but... it's works nicely locally for dev work like so, quite literally from something I was just working on:

import os

from timdex_dataset_api import TIMDEXDatasetMetadata
from timdex_dataset_api.config import configure_dev_logger

configure_dev_logger()  # <---------------

tdm = TIMDEXDatasetMetadata(os.environ["TIMDEX_DATASET_LOCATION"])

This ensures DEBUG logging from this library, but everything else is pretty quiet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Got it. There's a part of me that thinks logger -> tda_logger but 'tis a non-blocking suggestion!

@ghukill ghukill requested review from a team and jonavellecuerdo August 1, 2025 20:17
@ghukill ghukill changed the base branch from main to epic-timx-515 August 1, 2025 20:56
@ghukill ghukill merged commit 3311978 into epic-TIMX-515 Aug 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants