Skip to content

Fix uploading nn-train.mdb directory to Hugging Face#933

Open
juhoinkinen wants to merge 3 commits into
mainfrom
issue911-nn-train.mdb-directory-gets-uploaded-to-hf
Open

Fix uploading nn-train.mdb directory to Hugging Face#933
juhoinkinen wants to merge 3 commits into
mainfrom
issue911-nn-train.mdb-directory-gets-uploaded-to-hf

Conversation

@juhoinkinen
Copy link
Copy Markdown
Member

Fixes #911.

Previously it was detected only in file names
@juhoinkinen juhoinkinen added this to the 1.5 milestone Feb 13, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.63%. Comparing base (4479130) to head (b136f64).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #933   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files         103      103           
  Lines        8238     8242    +4     
=======================================
+ Hits         8208     8212    +4     
  Misses         30       30           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes the issue where the nn-train.mdb directory was being uploaded to Hugging Face when running the annif upload command. The fix modifies the filtering logic to detect training-related patterns in any part of the file path, not just the filename.

Changes:

  • Renamed _is_train_file() to _is_train_path() to better reflect its purpose
  • Modified the function to check all parts of a path for training patterns (e.g., "-train", "tmp-") instead of just the filename
  • Updated the call site to pass the relative path instead of just the filename

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread annif/hfh_util.py Outdated
Comment thread annif/hfh_util.py
Comment thread annif/hfh_util.py
juhoinkinen and others added 2 commits February 13, 2026 16:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@juhoinkinen juhoinkinen marked this pull request as ready for review February 17, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nn-train.mdb directory is uploaded to Hugging Face with annif upload

2 participants