Datasets:
Download README.md from jordangong/the-stack-v2-pr-before-subsampling: direct link, hf CLI and curl.
- Browser
- Download file 6.52 kB
-
https://huggingface.co/datasets/jordangong/the-stack-v2-pr-before-subsampling/resolve/main/README.md
- Command line
-
hf download hf://datasets/jordangong/the-stack-v2-pr-before-subsampling/README.md
-
curl -L -o README.md https://huggingface.co/datasets/jordangong/the-stack-v2-pr-before-subsampling/resolve/main/README.md
pretty_name: GitHub Pull Requests (Before Repository Subsampling)
tags:
- code
- github
- pull-requests
- software-engineering
task_categories:
- text-generation
size_categories:
- 10M<n<100M
configs:
- config_name: default
data_files:
- split: train
path: data/train-*.parquet
GitHub Pull Requests (Before Repository Subsampling)
Each row is one GitHub pull request, rendered as a single text document that combines the pull request's narrative and discussion with selected context from its code changes. The corpus is intended for pretraining code language models and for research on code changes and developer discussion.
This is not raw data. Every row has already been cleaned and rendered. The only difference from the companion repository-subsampled variant is that repository-aware subsampling was not applied, so you can choose your own sampling or weighting policy. License and opt-out filtering were not applied, so read Licensing before use.
Dataset facts
| Unit | One pull request per row |
| Rows | 17,997,937 |
| Split | train only |
| Compressed size | ~195.6 GB (184 Parquet files, Zstandard level 9) |
Schema
| Column | Type | Description |
|---|---|---|
pull_request.guid |
string | Identifier in the form owner/repo/pull/number. |
render |
string | Rendered document: pull-request narrative and discussion plus selected code-change context. |
len |
int64 | Length of render in Unicode characters (Python len), not bytes or tokens. |
lang_distr_json |
string | JSON-encoded heuristic language annotations: language (may be null), file/path key, and base-content character count. Not a verified language label for the pull request. |
expected_pairs |
int64 | Number of commit pairs in the retrieval plan. |
successful_content_pairs |
int64 | Content-bearing pairs retrieved, before pair-quality filtering. |
cleaned_pairs |
int64 | Pairs that survived cleaning. |
all_pairs_resolved |
bool | Every planned pair ended as ok (content retrieved) or no_text_changes. |
all_pairs_have_content |
bool | Every planned pair ended as ok. Does not mean every original file, revision, or cleaned pair appears in render. |
Loading the data
Streaming is recommended given the size.
from datasets import load_dataset
ds = load_dataset("jordangong/the-stack-v2-pr-before-subsampling", split="train", streaming=True)
for row in ds.take(3):
print(row["pull_request.guid"], row["len"])
print(row["render"][:1000])
# Optional: keep rows whose planned commit pairs were all retrieved with content.
complete = ds.filter(lambda row: row["all_pairs_have_content"])
That filter reflects retrieval coverage only. It is not evidence of quality, licensing status, or safety.
How the data was built
Pull-request histories were reconstructed from GHArchive events. File content for each pull request's planned base/head commit pairs was then retrieved from the corresponding Git repositories. The data was cleaned and rendered with an adapted version of the pull-request pipeline from BigCode's The Stack v2. Filters cover file quality, changed ranges, a language blacklist, pull-request history rules, and rendered size. Rendering selects discussion and code context within fixed bounds. Historical review comments whose code hunks could not be mapped may be omitted.
A planned pair with no text changes counts as resolved without content. Other pairs may remain unresolved because history was unavailable, access or transport failed, or retrieval hit resource or policy limits. The coverage columns let you inspect retrieval completeness row by row.
Repository subsampling not applied
The companion variant adds a deterministic, repository-aware retention step that lowers the probability of keeping a pull request as its repository's count of eligible histories grows. That step was not applied to these rows. Repositories with many pull requests keep all of their surviving rows, so they carry more weight here than in the subsampled variant. If that matters for your use, apply your own sampling or weighting by repository.
Licensing
The upstream pipeline includes license filtering and opt-out filtering. Neither was applied here because the required input data was unavailable. This release does not establish a dataset-wide license for redistribution or training, and it does not inherit the licensing or opt-out assurances of The Stack v2. It should not be described as permissively licensed or opt-out compliant. The code and text come from public GitHub repositories, and the rights of their original authors and licensors still apply. You are responsible for determining whether your intended use is permitted.
Limitations and responsible use
- Partial, biased coverage. A row is not a full repository snapshot or a complete record of the pull request. History, files, and code changes may be missing. Retrieval and filtering shape which pull requests appear, and large or inaccessible histories may be underrepresented.
- Heuristic annotations. Language labels come from filename and content heuristics (including Pygments) and are imperfect. Some files are unlabeled. Generated and vendored files were not identified or excluded.
- Privacy and safety. A legacy username-replacement step was applied, but this is not comprehensive anonymization. No full audit for personal information, secrets, or security issues was done. Rows may contain personal data, credentials, offensive text, or vulnerable or malicious code. Do not execute content from this dataset.
- No decontamination or deduplication. Content may overlap with public benchmarks or repeat across pull requests.
- Not evaluation or instruction data. Only a
trainsplit is provided. If you need held-out data, build repository-disjoint splits. Rows are rendered documents, not curated question/answer or chat examples. No model-performance results are reported.
Related variant and attribution
The repository-subsampled variant is a subset of this dataset. Do not concatenate the two as independent data, because doing so duplicates pull requests.
The processing code is adapted from BigCode's The Stack v2 pull-request and issue pipeline. This is an independently processed release, not an official BigCode dataset.