Remove committed Python bytecode cache from perf pipeline scripts - #4550
Merged
Conversation
The perf pipeline scripts directory contained a checked-in __pycache__/perf_to_kusto.cpython-314.pyc artifact that nothing referenced; the pipeline invokes perf_to_kusto.py directly via python3. Delete the artifact, add __pycache__/ and *.py[cod] to .gitignore, and export PYTHONDONTWRITEBYTECODE=1 from the perf entry points so bytecode caches are never written back into the checkout. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2fd9c200-e580-4516-bbd8-09ede1f8d789
Contributor
There was a problem hiding this comment.
Pull request overview
Removes an accidentally committed Python bytecode cache artifact from the perf pipeline tooling and adds safeguards to prevent .pyc regeneration from dirtying the eng/ checkout during perf runs.
Changes:
- Deleted the checked-in
perf_to_kusto.cpython-314.pycartifact undereng/pipelines/perf/scripts/__pycache__/. - Updated
.gitignoreto ignore__pycache__/and*.py[cod]across the repo. - Set
PYTHONDONTWRITEBYTECODE=1in perf entry-point scripts and the Kusto ingest pipeline step to keep pipeline checkouts clean.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| eng/pipelines/perf/sqlclient-perf-pipeline.yml | Exports PYTHONDONTWRITEBYTECODE=1 in the Kusto ingest bash inline script to avoid writing .pyc under eng/ during ingestion. |
| eng/pipelines/perf/scripts/translate_results_to_kusto.sh | Exports PYTHONDONTWRITEBYTECODE=1 near script start so helper Python invocations don’t emit __pycache__. |
| eng/pipelines/perf/scripts/run-perf-tests.sh | Exports PYTHONDONTWRITEBYTECODE=1 near script start to prevent .pyc creation during the Linux perf run. |
| eng/pipelines/perf/scripts/run-perf-tests.ps1 | Sets $env:PYTHONDONTWRITEBYTECODE early so Windows perf runs don’t write __pycache__ content into the repo tree. |
| .gitignore | Ignores Python bytecode caches (__pycache__/, *.py[cod]) to prevent accidental staging. |
| eng/pipelines/perf/scripts/pycache/perf_to_kusto.cpython-314.pyc | Removed committed CPython bytecode artifact. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mdaigle
approved these changes
Aug 18, 2026
benrr101
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
eng/pipelines/perf/scripts/had a checked-in Python bytecode artifact,__pycache__/perf_to_kusto.cpython-314.pyc, that was accidentally committedalongside the perf tooling. Nothing consumes it: the pipeline and
translate_results_to_kusto.shboth invokeperf_to_kusto.pydirectly viapython3, and CPython regenerates its own cache on import. It is alsoversion-pinned to CPython 3.14, so it is dead weight on every other agent.
Changes:
eng/pipelines/perf/scripts/__pycache__/perf_to_kusto.cpython-314.pyc.__pycache__/and*.py[cod]to.gitignoreso bytecode is neverstaged again.
PYTHONDONTWRITEBYTECODE=1from the four perf entry points that shellout to Python (
run-perf-tests.sh,run-perf-tests.ps1,translate_results_to_kusto.sh, and the Kusto ingest step insqlclient-perf-pipeline.yml) so pipeline runs leave the checkout clean.This is engineering hygiene only. No product code, public API, or pipeline
behaviour changes; the perf scripts run exactly as before, just without
writing
.pycfiles back intoeng/.Issues
N/A
Testing
No automated tests exist for the perf shell/pipeline tooling, so validation was
done by direct execution:
bash -nonrun-perf-tests.shandtranslate_results_to_kusto.sh(syntax OK).sqlclient-perf-pipeline.ymlparses as valid YAML.python3 eng/pipelines/perf/scripts/perf_to_kusto.py --helpruns standalonewith the
.pycremoved, confirming nothing depended on it.py_compile.__pycache__directory reappears in the scripts folder afterrunning them.