Skip to content

Commit e1920c0

Browse files
feat: Add contributors stream (#407)
Trying to pick up the torch from #268, since we also have a need for this stream. :) Added @MindaugasN to the commit for credit. Co-authored-by: MindaugasN <[email protected]>
1 parent d6e051e commit e1920c0

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tap_github/repository_streams.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,3 +2703,25 @@ class DeploymentStatusesStream(GitHubRestStream):
27032703
th.Property("environment_url", th.StringType),
27042704
th.Property("log_url", th.StringType),
27052705
).to_dict()
2706+
2707+
2708+
class CustomPropertiesStream(GitHubRestStream):
2709+
"""Defines 'custom_properties' stream."""
2710+
2711+
name = "custom_properties"
2712+
path = "/repos/{org}/{repo}/properties/values"
2713+
primary_keys: ClassVar[list[str]] = ["repo", "org", "property_name"]
2714+
replication_key = None
2715+
parent_stream_type = RepositoryStream
2716+
ignore_parent_replication_key = True
2717+
state_partitioning_keys: ClassVar[list[str]] = ["repo", "org"]
2718+
2719+
schema = th.PropertiesList(
2720+
# Parent Keys
2721+
th.Property("repo", th.StringType),
2722+
th.Property("org", th.StringType),
2723+
th.Property("repo_id", th.IntegerType),
2724+
# Custom Property Keys
2725+
th.Property("property_name", th.StringType),
2726+
th.Property("value", th.StringType),
2727+
).to_dict()

tap_github/streams.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
CommitsStream,
2121
CommunityProfileStream,
2222
ContributorsStream,
23+
CustomPropertiesStream,
2324
DependenciesStream,
2425
DependentsStream,
2526
DeploymentsStream,
@@ -130,6 +131,7 @@ def __init__(self, valid_queries: set[str], streams: list[type[Stream]]) -> None
130131
ORGANIZATIONS = (
131132
{"organizations"},
132133
[
134+
CustomPropertiesStream,
133135
OrganizationStream,
134136
OrganizationMembersStream,
135137
TeamMembersStream,

0 commit comments

Comments
 (0)