Skip to content

Hotfix/skip details - #10

Merged
combinatorist merged 8 commits into
mainfrom
hotfix/skip-details
Sep 17, 2025
Merged

Hotfix/skip details#10
combinatorist merged 8 commits into
mainfrom
hotfix/skip-details

Conversation

@combinatorist

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread src/config.py
Comment on lines +16 to +17
POST_DETAILS_TO_CTFG: bool = "TRUE".startswith(
os.getenv("POST_DETAILS_TO_CTFG", "False").upper()

Copy link
Copy Markdown
Collaborator Author

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

Comment thread src/config.py Outdated
Comment on lines +40 to +41
WIKIDATA_MAX_LISTINGS_TO_SEARCH: int = int(
os.getenv("WIKIDATA_MAX_LISTINGS_TO_SEARCH", 5)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this externally configurable.

Comment thread src/ctfg.py
# WikidataItem.recursive_save(wiki_items)
if wiki_items:
log("Example item")
pprint(wiki_items[0].to_record())

Copy link
Copy Markdown
Collaborator Author

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)

Comment thread pyproject.toml
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",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Using a fork!

Comment thread src/config.py
Comment on lines +40 to +42
def getEnvInt(name: str, default: int) -> int:
raw = os.getenv("WIKIDATA_MAX_RESULTS_PER_SEARCH")
return int(raw) if raw else default

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safer int retrieval

Comment thread src/wiki.py
Comment on lines +21 to +23
sample(matchable_items, max_attempts)
if max_attempts and max_attempts < len(matchable_items)
else matchable_items

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safer sampling

@combinatorist
combinatorist merged commit 5f3a319 into main Sep 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant