litestar-org / litestar-org/polyfactory

Bug: Typo in `field_meta.py` ?

Open
#443 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.5k
Forks
120
PR merge metrics
No merged PRs in 30d

Description

Description

By analogy, I assume the line:

"max_length": getattr(value, "max_length", getattr(value, "max_length", None)),

should be:

"max_length": getattr(value, "max_length", getattr(value, "max_items", None)),

(if it is not a typo, the second getattr is redundant and could be removed)

https://github.com/litestar-org/polyfactory/blob/b479e4af4617d108cbd90890cbda4408ee51ba4a/polyfactory/field_meta.py#L211-L212

URL to code causing the issue

https://github.com/litestar-org/polyfactory/blob/b479e4af4617d108cbd90890cbda4408ee51ba4a/polyfactory/field_meta.py#L211

MCVE

No response

Steps to reproduce

No response

Screenshots

No response

Logs

No response

Release Version

2.12.0

Platform
  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Contributor guide

Open the contributing guide

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.

Research direction

Start by reading polyfactory/field_meta.py at the referenced line and inspect how max_length and max_items are used in the surrounding metadata handling. Verify whether the repeated max_length lookup is intentional, then make the smallest correction if needed and confirm the relevant project tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.