Skip to content

Raise a clear error when there is no default project - #17

Closed
scschneider44 wants to merge 1 commit into
masterfrom
fix/default-project-null
Closed

scschneider44 wants to merge 1 commit into
masterfrom
fix/default-project-null

Conversation

@scschneider44

Copy link
Copy Markdown
Contributor

After rowansci/eyrie#963, GET /user/me/default_project returns null (200) when the user has no default project in the API key's org. Before, it returned a 500. default_project() called Project(**response.json()) on that null and failed with TypeError: argument after ** must be a mapping, not NoneType.

Changes

  • Clear error: default_project() raises ValueError("You have no default project in this organization. Set a default project, or pass a folder or project.") when the API returns null. That matches the server's wording for folder-less work.
  • Affected paths: every SDK path that falls back to the default project goes through it, including workflow submission without a folder and folder creation, listing and lookup without a project.

Testing

  • New tests/test_project.py checks that a default project is returned when there is one, and that a missing one raises the clear error. The second test fails on the old code.
  • uv run prek run --all-files --stage pre-push: ruff, ty, pytest and the other hooks pass.

🤖 Generated with Claude Code

GET /user/me/default_project now returns null when the user has no default
project in the key's organization (rowansci/eyrie#963). default_project()
built a Project from that null and failed with a TypeError; it now raises a
ValueError saying there is no default project and to set one or pass a
folder or project. Folder creation, listing and workflow submission without
a folder all go through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliaslmann eliaslmann closed this Oct 6, 2026
@scschneider44
scschneider44 deleted the fix/default-project-null branch October 6, 2026 17:05
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