Skip to content

Feature/unify settings formats#2114

Merged
JeltevanBoheemen merged 4 commits into
feature/corpus-settingsfrom
feature/unify-settings-formats
Jul 15, 2026
Merged

Feature/unify settings formats#2114
JeltevanBoheemen merged 4 commits into
feature/corpus-settingsfrom
feature/unify-settings-formats

Conversation

@JeltevanBoheemen

@JeltevanBoheemen JeltevanBoheemen commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reverts the get_deprecated_setting helper, and adjusts all corpora using it to the new settings format.

Also removes (almost) all old-style settings (getatttr(settings.SOME_SETTING, <default>). Exceptions:

  • Course Explorer related corpora
  • Peace Portal related corpora

This was a combination of manual moving of settings, and using an LLM-based helper. So a quick sanity check would be much appreciated.

Deployment

Branches updated for:

Sanity checks also appreciated

@lukavdplas lukavdplas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! A few minor changes required.

Comment thread backend/corpora/guardianobserver/guardianobserver.py
Comment thread backend/corpora/parliament/netherlands.py
Comment on lines -19 to 23
TIMES_DATA = os.path.join(BASE_DIR, 'addcorpus', 'python_corpora', 'tests')
TIMES_ES_INDEX = 'test-times'

UBLAD_DATA = '' # necessary to make ublad test not fail
CORPUS_SETTINGS = {
"times": {
"data_directory": os.path.join(BASE_DIR, 'addcorpus', 'python_corpora', 'tests'),
"es_index": "test-times",
},
"ublad": {
"data_directory": ""
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The ublad setting isn't needed anymore. This would have been required to import the module in a test:

from corpora.ublad.ublad import transform_date

The ublad module would raise an AttributeError on import if settings.UBLAD_DATA does not exist. But now you can just import the module, yay!

@JeltevanBoheemen
JeltevanBoheemen merged commit 7bf1227 into feature/corpus-settings Jul 15, 2026
3 checks passed
@JeltevanBoheemen
JeltevanBoheemen deleted the feature/unify-settings-formats branch July 15, 2026 11:32
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.

2 participants