fix: edit wikidata.py to make it work(especially for ./examples/01_prepare_data/wikidata_knowledge_graph.ipynb)#2311
Open
LioneWang wants to merge 2 commits into
Open
fix: edit wikidata.py to make it work(especially for ./examples/01_prepare_data/wikidata_knowledge_graph.ipynb)#2311LioneWang wants to merge 2 commits into
LioneWang wants to merge 2 commits into
Conversation
Contributor
|
Hi! Just a quick note — PRs shouldn’t be opened against the For reference, please see the contributing guide: |
|
|
||
| API_URL_WIKIPEDIA = "https://en.wikipedia.org/w/api.php" | ||
| API_URL_WIKIDATA = "https://query.wikidata.org/sparql" | ||
| WIKIDATA_API_URL = "https://www.wikidata.org/w/api.php" |
Collaborator
There was a problem hiding this comment.
Suggested change
| WIKIDATA_API_URL = "https://www.wikidata.org/w/api.php" | |
| API_URL_WIKIPEDIA = "https://www.wikidata.org/w/api.php" | |
| API_URL_WIKIDATA = "https://query.wikidata.org/sparql" |
better to keep the same name for consistency. And we can't erase the sparql endpoint, otherwise the rest of the tests will fail: python -m pytest tests/data_validation/recommenders/datasets/test_wikidata.py -v
| try: | ||
| response = session.get(API_URL_WIKIPEDIA, params=params) | ||
| response.raise_for_status() # Raise HTTPError for bad responses | ||
| response = session.get(WIKIDATA_API_URL, params=params) |
Collaborator
There was a problem hiding this comment.
Suggested change
| response = session.get(WIKIDATA_API_URL, params=params) | |
| response = session.get(API_URL_WIKIPEDIA, params=params) |
As mentioned above, better to keep the name for consistency
Collaborator
|
there are some errors: FYI @LioneWang |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issues
References
Checklist:
git commit -s -m "your commit message".staging branchAND NOT TOmain branch.