MCPcopy Create free account
hub / github.com/apache/datafusion / parse_existing_table

Function parse_existing_table

docs/scripts/update_committer_list.py:98–131  ·  view source on GitHub ↗

Parse the existing committer table from the markdown content.

(content: str)

Source from the content-addressed store, hash-verified

96
97
98def parse_existing_table(content: str) -> List[Committer]:
99 """Parse the existing committer table from the markdown content."""
100 committers = []
101
102 # Find the table between the markers
103 start_marker = "<!-- Begin Auto-Generated Committer List -->"
104 end_marker = "<!-- End Auto-Generated Committer List -->"
105
106 start_idx = content.find(start_marker)
107 end_idx = content.find(end_marker)
108
109 if start_idx == -1 or end_idx == -1:
110 return committers
111
112 table_content = content[start_idx:end_idx]
113
114 # Parse table rows (skip header and separator)
115 lines = table_content.split('\n')
116 for line in lines:
117 line = line.strip()
118 if line.startswith('|') and '---' not in line and line.count('|') >= 4:
119 # Split by | and clean up
120 parts = [part.strip() for part in line.split('|')]
121 if len(parts) >= 5:
122 name = parts[1].strip()
123 apache = parts[2].strip()
124 github = parts[3].strip()
125 affiliation = parts[4].strip()
126 role = parts[5].strip()
127
128 if name and name != 'Name' and (not '-----' in name):
129 committers.append(Committer(name, apache, github, affiliation, role))
130
131 return committers
132
133
134def generate_table_row(committer: Committer) -> str:

Callers 1

update_governance_fileFunction · 0.85

Calls 4

CommitterClass · 0.85
splitMethod · 0.45
countMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…