Implementation:Mage ai Mage ai GitHub Pull Requests Schema
| Knowledge Sources | |
|---|---|
| Domains | Data_Integration, GitHub, Schema |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
JSON Schema definition for GitHub pull request records used by the Singer-based GitHub source connector.
Description
This schema defines the structure and types for pull request data extracted from the GitHub Pull Requests API. It is the largest schema in the GitHub source connector at 1646 lines, reflecting the rich data model of pull requests. The schema follows the JSON Schema specification with additionalProperties set to false and includes top-level properties such as _sdc_repository, id, node_id, statuses_url, draft, requested_reviewers (an array of reviewer objects with name, email, login, id, avatar_url, and other user fields), merge_commit_sha, review_comments_url, active_lock_reason, author_association, diff_url, assignee, comments_url, head, and commits_url.
Usage
This schema is automatically loaded by the GitHub source connector during the discovery phase. It defines the available columns and their types for the pull_requests stream.
Code Reference
Source Location
- Repository: mage-ai
- File: mage_integrations/mage_integrations/sources/github/tap_github/schemas/pull_requests.json
- Lines: 1-1646
Signature
{
"type": ["null", "object"],
"additionalProperties": false,
"properties": {
"_sdc_repository": { "type": ["string"] },
"id": { "type": ["null", "string"] },
"node_id": { "type": ["null", "string"] },
"statuses_url": { "type": ["null", "string"] },
"draft": { "type": ["null", "boolean"] },
"requested_reviewers": { "type": ["null", "array"], "items": { "type": ["null", "object"], "properties": { "name": {}, "email": {}, "login": {}, "id": {} } } },
"merge_commit_sha": { "type": ["null", "string"] },
"author_association": { "type": ["null", "string"] },
"head": { "type": ["null", "object"], "..." : "..." },
"commits_url": { "type": ["null", "string"] }
}
}
Import
# Loaded automatically by Source.load_schemas_from_folder()
# Path: mage_integrations/mage_integrations/sources/github/tap_github/schemas/pull_requests.json
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | JSON file | Yes | Loaded from disk by schema loader |
Outputs
| Name | Type | Description |
|---|---|---|
| schema | dict | JSON Schema object with properties, types, and format constraints |
Usage Examples
import json
import os
schema_path = os.path.join(
"mage_integrations/mage_integrations/sources/github/tap_github/schemas",
"pull_requests.json"
)
with open(schema_path) as f:
schema = json.load(f)
print(list(schema["properties"].keys()))