Skip to content

fix(#354): read ckan.plugins as a list in FormulaStage.should_skip - #356

Open
tino097 wants to merge 1 commit into
mainfrom
354-formula-stage-plugins-list
Open

tino097 wants to merge 1 commit into
mainfrom
354-formula-stage-plugins-list

Conversation

@tino097

@tino097 tino097 commented Oct 28, 2026

Copy link
Copy Markdown
Member

Fixes #354

Proposed fixes:

FormulaStage.should_skip read ckan.plugins with .split(). CKAN declares that option as a list since 2.10, so tk.config.get("ckan.plugins") returns a list, the AttributeError was swallowed by the broad except Exception, and the stage logged Unable to check ckan.plugins configuration: 'list' object has no attribute 'split' and skipped DRUF formula processing on every job, even with ckanext-scheming enabled.

The stage now reads the option through toolkit.aslist, which accepts both the list and the legacy string form. A regression test covers the list form with scheming, the string form with scheming, and a list without scheming.

Check Observed result
pytest tests/test_issue_354_plugins_list.py before the fix 2 failed, 1 passed
pytest tests/test_issue_354_plugins_list.py after the fix 3 passed
pytest tests --ignore=tests/integration --ignore=tests/js (with --ckan-ini) 345 passed, 1 skipped
flake8 --extend-ignore=E501 on the test file clean
  • The broad except Exception is unchanged. Narrowing it so a real config failure is not reported as "scheming not enabled" is a separate decision; this PR only fixes the cause the except was hiding.
  • Two pre-existing flake8 findings in formula.py are left alone (unused Optional import, a continuation indent on the scheming_plugins list); they are not on the changed lines.
  • Observed on CKAN 2.13.0a0 with prefect_enabled = false; the same should_skip runs on the Prefect path.

🤖 Generated with Claude Code

CKAN declares ckan.plugins as a list option since 2.10, so
tk.config.get("ckan.plugins") returns a list. should_skip called .split()
on it, the AttributeError was caught by the broad except and reported as
"skip", so DRUF formula processing was silently disabled on every job
even with ckanext-scheming enabled.

Read the option through toolkit.aslist, which accepts both the list and
the legacy string form. Regression test covers both forms and the
no-scheming case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@tino097

tino097 commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

The failing unit and integration checks here die on import prefect (TypeError: Body() got an unexpected keyword argument 'min_items', FastAPI 0.155+ vs Prefect 3.7.8) before any test runs. That is #353, not this change; main fails the same way. #358 pins fastapi<0.155; once it lands, rerunning the checks here should go green.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 7 complexity · 0 duplication

Metric Results
Complexity 7
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

✅ No blocking issues noticed

No blocking findings were identified. The required list-valued, legacy string-valued, and scheming-absent plugin configurations are covered by regression tests.

Test suggestions

  • Scheming is detected in a list-valued ckan.plugins configuration.
  • Scheming is detected in a legacy string-valued ckan.plugins configuration.
  • Formula processing is skipped when the plugin list lacks scheming.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

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.

FormulaProcessing stage always skipped on CKAN 2.10+: ckan.plugins is a list, stage calls .split() on it

1 participant