MCPcopy Create free account
hub / github.com/FastLED/FastLED / fetch_date_field

Function fetch_date_field

ci/github_project_drift_sync.py:200–219  ·  view source on GitHub ↗

Return the field ID of the named Date field.

(owner: str, number: int, date_field_name: str)

Source from the content-addressed store, hash-verified

198
199
200def fetch_date_field(owner: str, number: int, date_field_name: str) -> str:
201 """Return the field ID of the named Date field."""
202 q = (
203 'query { organization(login: "'
204 + owner
205 + '") { projectV2(number: '
206 + str(number)
207 + ') { field(name: "'
208 + date_field_name
209 + '") { ... on ProjectV2Field { id dataType } } } } }'
210 )
211 d = graphql(q)
212 field = d["data"]["organization"]["projectV2"]["field"]
213 if not field:
214 raise RuntimeError(f"Date field '{date_field_name}' not found")
215 if field.get("dataType") != "DATE":
216 raise RuntimeError(
217 f"Field '{date_field_name}' is not a DATE field (got {field.get('dataType')})"
218 )
219 return str(field["id"])
220
221
222def set_date_posted(

Callers 1

mainFunction · 0.85

Calls 2

graphqlFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected