Skip to content

Conversation

@hagenw
Copy link
Member

@hagenw hagenw commented Mar 7, 2025

Closes #197

Solution proposed by Calude Code.

Summary by Sourcery

Tests:

  • Add a test to verify the creation and functionality of the '.complete' file, including backward compatibility with the header flag method for checking database completeness.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 7, 2025

Reviewer's Guide by Sourcery

This pull request introduces a .complete file to the database root directory as an indicator of a fully loaded database. It also switches to using yaml.SafeLoader for loading YAML configuration files.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added a .complete file to the database root directory to indicate that the database has been fully loaded.
  • Added a check for the existence of the .complete file when determining if a database is complete.
  • Created the .complete file upon successful database loading.
  • Maintained backward compatibility by continuing to update the complete flag in the database header.
  • Added a constant to define the name of the complete file.
tests/test_load.py
audb/core/load.py
audb/core/define.py
Switched from yaml.BaseLoader to yaml.SafeLoader when loading YAML configuration files.
  • Updated the YAML loader to use SafeLoader for security reasons.
audb/core/config.py

Assessment against linked issues

Issue Objective Addressed Explanation
#197 Create a .complete file in the cache folder to signal that a database is complete.
#197 Only acquire the lock if the .complete file does not exist. The PR creates the .complete file, and checks for its existence, but does not modify the locking mechanism to only acquire the lock if the file does not exist. The locking mechanism is not present in the diff.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

Do not lock cache folder for complete database

2 participants