Default validators are not reasonable

Open
#764 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
databases

Research direction

Start by comparing the default validators in v20250914.1 and v20250920.1, then reproduce the failure with a legacy read-only table containing a reference column with an empty value. Trace the reference-column validation path and add a regression test; done means allowed empty reference values no longer error without an explicit validator.

Written by the indexing model from the issue text.

Description

Until v20250914.1 everything was working fine for my application.
Starting from v20250920.1 I started seeing serious problems with some of my tables. Specifically those are "legacy" tables (pre-existing, defined as read-only in my application).

With the help of AI I finally found out how to understand and overcome the problem.
Looks like the new default validators since v20250920.1 cannot handle "empty" values properly for reference columns, which results in an error.
The workaround is to add an explicit validator to all the reference columns:

requires=[IS_EMPTY_OR(Validator())]

Looks to me that this should already be the default for those validators. Empty fields (if allowed in the table setup) do not need any validation.

Dominant language
Python
Stars
540
Forks
151
Avg merge
12d 14h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from web2py/pydal

All issues in web2py/pydal

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.