Skip to content

fix(azure-ai-projects): skip all dot-prefixed directories in evaluator upload#46063

Open
w-javed wants to merge 2 commits intofeature/azure-ai-projects/2.0.2from
waqasjaved02/skip-dot-dirs-evaluator-upload
Open

fix(azure-ai-projects): skip all dot-prefixed directories in evaluator upload#46063
w-javed wants to merge 2 commits intofeature/azure-ai-projects/2.0.2from
waqasjaved02/skip-dot-dirs-evaluator-upload

Conversation

@w-javed
Copy link
Copy Markdown
Contributor

@w-javed w-javed commented Apr 1, 2026

Description

Change the evaluator upload skip_dirs filter to exclude any directory starting with . instead of only hardcoding .git and .venv. This covers:

  • .venv, .git (previously handled)
  • .mypy_cache, .tox, .pytest_cache, .ruff_cache, .idea, .vscode, etc.

Applied to both sync (_patch_evaluators.py) and async (_patch_evaluators_async.py) upload functions.

Changes

  • Removed .git and .venv from the explicit skip_dirs set (now covered by the startswith('.') check)
  • Added not d.startswith('.') condition to the dirs[:] filter in os.walk
  • Updated docstrings to reflect the new behavior

…r upload

Change skip_dirs filter to exclude any directory starting with '.' instead
of only '.git' and '.venv'. This covers .venv, .git, .mypy_cache, .tox,
.pytest_cache, and any other hidden/tool directories.

Applied to both sync and async upload functions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-ai-projects

Copy link
Copy Markdown
Member

@nagkumar91 nagkumar91 left a comment

Choose a reason for hiding this comment

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

nit: Now that dot-prefixed directories are excluded, consider applying the same treatment to files — e.g. .env, .DS_Store, .gitignore would still get uploaded. A simple file_name.startswith('.') guard in the existing skip check would close that gap:

if file_name.startswith('.') or any(file_name.endswith(ext) for ext in skip_extensions):
    continue

Extend the existing skip logic to also exclude dot-prefixed files
(e.g. .env, .DS_Store, .gitignore) from evaluator uploads, matching
the treatment already applied to dot-prefixed directories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skips ``__pycache__``, ``.git``, ``.venv``, ``venv``, ``node_modules``
Skips directories starting with ``.`` (e.g. ``.git``, ``.venv``),
``__pycache__``, ``venv``, ``node_modules``
directories and ``.pyc`` / ``.pyo`` files.
Copy link
Copy Markdown
Member

@dargilco dargilco Apr 2, 2026

Choose a reason for hiding this comment

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

I don't think it's a good idea to hard code a list of folders, and this is specific to the environment you happen to run the code. A better way is to add an input variable like folder_exclutions_pattern: Optional[re.Pattern] = None, where you provide a reg ex of the folders to exclude. Default is to include all folders.

And per one of my comments earlier, please add file_pattern: Optional[re.Pattern] = None, to match what we have in dataset upload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants