#๐Ÿ”’ Running into some difficulties w. GitHub Actions & WikiData API

31 messages ยท Page 1 of 1 (latest)

potent pilot
#

I'll preface this by saying that I'm learning to develop/code through online tutorials. I am certain I'm not always using the right words, so please bear with me.

I have a script that uses wikidata API to enrich a staging table in a PostgressDB on Supabase. When I run the script locally, it works just fine. When I run it using github actions - it kicks back either a HTTP 400 or HTTP 429, which surprises me because I have secrets setup on GitHub for my Wiki token.

All this is to say, since I don't understand exactly what's failing, i don't know what to specifically ask but I would be most appreciative if someone could point me in the right direction or tell me if this is a simple fix or what. Attached is my script.

Here's a sample from the log file that's created when I run the script. It's roughly 21000 lines of failures and all of them are either 400 or 429.

the script: #1378867091754451125 message

2025-06-01 14:24:33,236 | ERROR | Wikidata request failed for Q4909858: HTTP 400 | URL: https://www.wikidata.org/wiki/Special:EntityData/Q4909858.json
2025-06-01 14:24:33,882 | ERROR | Wikidata request failed for Q4908749: HTTP 400 | URL: https://www.wikidata.org/wiki/Special:EntityData/Q4908749.json
2025-06-01 14:24:34,403 | ERROR | Wikidata request failed for Q2939390: HTTP 429 | URL: https://www.wikidata.org/wiki/Special:EntityData/Q2939390.json
2025-06-01 14:24:34,924 | ERROR | Wikidata request failed for Q4913241: HTTP 429 | URL: https://www.wikidata.org/wiki/Special:EntityData/Q4913241.json```
vast flumeBOT
#

@potent pilot

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

potent pilot
naive flare
potent pilot
#

and a time out of 10

naive flare
naive flare
#

What response body are you getting with the 400 error?

potent pilot
#

that's what I'm hoping. In non technical terms - i use various pvalues to update fields in my database table.

#

by response body - i think you're talking about printing the details of those 400 error? I'm not doing anything more than logging the information from the sample.

#

or rather - consistent with the sample.

naive flare
potent pilot
#

gotcha. I'll run it again with a more robust log.

#

i'll @ you when it's finished and i'll paste that up here.

#

what other things should i be logging for you to be able to understand the problem better?

naive flare
#

all the request bodies when the response isn't 200, probably

potent pilot
#

gotcha.

naive flare
potent pilot
#

yeah i don't think it is but again, my understanding is very limited - when i run it locally it worked fine.

#

one thing that i don't understand though - is that i was doing a "GET" request

#

and in my reading i thought that meant that there werent headers involved.

naive flare
potent pilot
#

cool. so yeah something like "logging.error(f"Headers Sent: {headers}")" should work then i would think.

#

i'll definitely bookmark that - thanks kindly. i'll go run the script with a more robust log and comeback in a bit

vast flumeBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.