-
Notifications
You must be signed in to change notification settings - Fork 0
Hotfix/skip details #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| POST_DETAILS_TO_CTFG: bool = "TRUE".startswith( | ||
| os.getenv("POST_DETAILS_TO_CTFG", "False").upper() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main change: this cuts down on unnecessary records
src/config.py
Outdated
| WIKIDATA_MAX_LISTINGS_TO_SEARCH: int = int( | ||
| os.getenv("WIKIDATA_MAX_LISTINGS_TO_SEARCH", 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this externally configurable.
| # WikidataItem.recursive_save(wiki_items) | ||
| if wiki_items: | ||
| log("Example item") | ||
| pprint(wiki_items[0].to_record()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better logging (know how many before start and only show example if available)
| requires-python = "<4.0,>=3.13" | ||
| dependencies = [ | ||
| "wikibaseintegrator @ git+https://github.com/LeMyst/WikibaseIntegrator.git@301067883ddce0bca31fdd54973c3d6c8cbbcb7d", | ||
| "wikibaseintegrator @ git+https://github.com/combinatorist/WikibaseIntegrator.git@feature/search_entities-exact-max_results", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def getEnvInt(name: str, default: int) -> int: | ||
| raw = os.getenv("WIKIDATA_MAX_RESULTS_PER_SEARCH") | ||
| return int(raw) if raw else default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safer int retrieval
| sample(matchable_items, max_attempts) | ||
| if max_attempts and max_attempts < len(matchable_items) | ||
| else matchable_items |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safer sampling
No description provided.