
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
`StrictBytes` does not raise `ValidationError` when `max_length` is present in `Field` Β· Issue #4380 Β· pydantic/pydantic
Description:
Initial Checks I have searched GitHub for a duplicate issue and I'm sure this is something new I have searched Google & StackOverflow for a solution and couldn't find anything I have re...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Photography
- Fitness & Wellness
- Virtual Reality
Content Management System {π}
What CMS is github.com built with?
Github.com is built with WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,000,003 visitors per month in the current month.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 4,989,880 paying customers.
The estimated monthly recurring revenue (MRR) is $20,957,498.
The estimated annual recurring revenues (ARR) are $251,489,970.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
strictbytes, field, pydantic, raise, maxlength, assert, validationerror, present, bug, import, modelabarthur, strerrorvalue, issue, class, def, error, failed, sign, code, arthurazs, version, model, pytest, pytestraisesvalidationerror, hramezani, samuelcolvin, github, basemodel, modelbasemodel, teststestmymodelpy, testbstr, python, data, type, navigation, pull, requests, actions, security, closed, description, searched, docs, fastapi, mypy, create, object, assume, modela, intended,
Topics {βοΈ}
cache/pypoetry/virtualenvs/asd-8jlwexqw-py3 hramezani edits member samuelcolvin edits member /home/arthurazs/ pydantic import basemodel comment metadata assignees personal information `strictbytes` test_b_str - failed def test_b_str pydantic version 1 pydantic v1 0-46-generic-x86_64 duplicate issue def test_a_str searched github docs type projects strictbytes = field raise python python-devtools =b'lucas' bug validation intended behaviour json strictbytes anymore =b'arthur' raise validationerror raise typeerror raise `validationerror` raise print =b'art' issue description failed ============================= 1 failed 10/lib/python3 private attributes intended behavior submitted asap jeanarhancet mentioned projects milestone milestone relationships assert 'value_error assert 'type_error tools - mypy pydantic type code github
Payment Methods {π}
- Braintree
Questions {β}
- @samuelcolvin what is your opinion here?
- Already have an account?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:`StrictBytes` does not raise `ValidationError` when `max_length` is present in `Field`
articleBody:### Initial Checks
- [X] I have searched GitHub for a duplicate issue and I'm sure this is something new
- [X] I have searched Google & StackOverflow for a solution and couldn't find anything
- [X] I have read and followed [the docs](https://pydantic-docs.helpmanual.io) and still think this is a bug
- [X] I am confident that the issue is with pydantic (not my code, or another library in the ecosystem like [FastAPI](https://fastapi.tiangolo.com) or [mypy](https://mypy.readthedocs.io/en/stable))
### Description
I'm using pydantic version 1.9.2.
Mind this model:
```python
# my_model/__init__.py
from pydantic import BaseModel, StrictBytes, Field
class Model(BaseModel):
a: StrictBytes = Field(...)
b: StrictBytes = Field(..., max_length=5)
```
Even though `b` is `StrictBytes`, I can create an object with the following line:
`m = Model(a=b'arthur', b=123)` which I assume is a bug.
I cannot create an object the other way around:
`m = Model(a=123, b=b'art')`, which I assume is the intended behaviour.
---
Here follows a pytest example:
```python
# tests/test_my_model.py
from my_model import Model
import pytest
from pydantic import ValidationError
def test_normal():
m = Model(a=b'arthur', b=b'lucas')
assert m.a == b'arthur'
assert m.b == b'lucas'
def test_large():
with pytest.raises(ValidationError) as error:
m = Model(a=b'arthur', b=b'arthur')
assert 'b\n' in str(error.value)
assert 'value_error.any_str.max_length' in str(error.value)
def test_a_str():
with pytest.raises(ValidationError) as error:
m = Model(a=123123, b=b'lucas')
assert 'a\n' in str(error.value)
assert 'type_error.bytes' in str(error.value)
def test_b_str():
with pytest.raises(ValidationError) as error:
m = Model(a=b'arthur', b=123) # does not raise
assert 'b\n' in str(error.value)
assert 'type_error.bytes' in str(error.value)
```
And the output from pytest:
```bash
platform linux -- Python 3.10.6, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/arthurazs/Desktop/my_model
collected 4 items
tests/test_my_model.py ...F [100%]
====================================== FAILURES =======================================
_____________________________________ test_b_str ______________________________________
def test_b_str():
> with pytest.raises(ValidationError) as error:
E Failed: DID NOT RAISE <class 'pydantic.error_wrappers.ValidationError'>
tests/test_my_model.py:24: Failed
=============================== short test summary info ===============================
FAILED tests/test_my_model.py::test_b_str - Failed: DID NOT RAISE <class 'pydantic.e...
============================= 1 failed, 3 passed in 0.04s =============================
```
### Example Code
```Python
from pydantic import BaseModel, StrictBytes, Field
class Model(BaseModel):
a: StrictBytes = Field(...)
b: StrictBytes = Field(..., max_length=5)
m = Model(a=b'arthur', b=123) # does not raise
```
### Python, Pydantic & OS Version
```Text
pydantic version: 1.9.2
pydantic compiled: True
install path: /home/arthurazs/.cache/pypoetry/virtualenvs/asd-8JLwExQw-py3.10/lib/python3.10/site-packages/pydantic
python version: 3.10.6 (main, Aug 2 2022, 15:11:28) [GCC 9.4.0]
platform: Linux-5.15.0-46-generic-x86_64-with-glibc2.31
optional deps. installed: ['typing-extensions']
```
### Affected Components
- [ ] [Compatibility between releases](https://pydantic-docs.helpmanual.io/changelog/)
- [X] [Data validation/parsing](https://pydantic-docs.helpmanual.io/usage/models/#basic-model-usage)
- [ ] [Data serialization](https://pydantic-docs.helpmanual.io/usage/exporting_models/) - `.dict()` and `.json()`
- [ ] [JSON Schema](https://pydantic-docs.helpmanual.io/usage/schema/)
- [ ] [Dataclasses](https://pydantic-docs.helpmanual.io/usage/dataclasses/)
- [ ] [Model Config](https://pydantic-docs.helpmanual.io/usage/model_config/)
- [X] [Field Types](https://pydantic-docs.helpmanual.io/usage/types/) - adding or changing a particular data type
- [ ] [Function validation decorator](https://pydantic-docs.helpmanual.io/usage/validation_decorator/)
- [ ] [Generic Models](https://pydantic-docs.helpmanual.io/usage/models/#generic-models)
- [ ] [Other Model behaviour](https://pydantic-docs.helpmanual.io/usage/models/) - `construct()`, pickling, private attributes, ORM mode
- [ ] [Settings Management](https://pydantic-docs.helpmanual.io/usage/settings/)
- [ ] [Plugins](https://pydantic-docs.helpmanual.io/) and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.
author:
url:https://github.com/arthurazs
type:Person
name:arthurazs
datePublished:2022-08-15T21:06:05.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:2
url:https://github.com/4380/pydantic/issues/4380
context:https://schema.org
headline:`StrictBytes` does not raise `ValidationError` when `max_length` is present in `Field`
articleBody:### Initial Checks
- [X] I have searched GitHub for a duplicate issue and I'm sure this is something new
- [X] I have searched Google & StackOverflow for a solution and couldn't find anything
- [X] I have read and followed [the docs](https://pydantic-docs.helpmanual.io) and still think this is a bug
- [X] I am confident that the issue is with pydantic (not my code, or another library in the ecosystem like [FastAPI](https://fastapi.tiangolo.com) or [mypy](https://mypy.readthedocs.io/en/stable))
### Description
I'm using pydantic version 1.9.2.
Mind this model:
```python
# my_model/__init__.py
from pydantic import BaseModel, StrictBytes, Field
class Model(BaseModel):
a: StrictBytes = Field(...)
b: StrictBytes = Field(..., max_length=5)
```
Even though `b` is `StrictBytes`, I can create an object with the following line:
`m = Model(a=b'arthur', b=123)` which I assume is a bug.
I cannot create an object the other way around:
`m = Model(a=123, b=b'art')`, which I assume is the intended behaviour.
---
Here follows a pytest example:
```python
# tests/test_my_model.py
from my_model import Model
import pytest
from pydantic import ValidationError
def test_normal():
m = Model(a=b'arthur', b=b'lucas')
assert m.a == b'arthur'
assert m.b == b'lucas'
def test_large():
with pytest.raises(ValidationError) as error:
m = Model(a=b'arthur', b=b'arthur')
assert 'b\n' in str(error.value)
assert 'value_error.any_str.max_length' in str(error.value)
def test_a_str():
with pytest.raises(ValidationError) as error:
m = Model(a=123123, b=b'lucas')
assert 'a\n' in str(error.value)
assert 'type_error.bytes' in str(error.value)
def test_b_str():
with pytest.raises(ValidationError) as error:
m = Model(a=b'arthur', b=123) # does not raise
assert 'b\n' in str(error.value)
assert 'type_error.bytes' in str(error.value)
```
And the output from pytest:
```bash
platform linux -- Python 3.10.6, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/arthurazs/Desktop/my_model
collected 4 items
tests/test_my_model.py ...F [100%]
====================================== FAILURES =======================================
_____________________________________ test_b_str ______________________________________
def test_b_str():
> with pytest.raises(ValidationError) as error:
E Failed: DID NOT RAISE <class 'pydantic.error_wrappers.ValidationError'>
tests/test_my_model.py:24: Failed
=============================== short test summary info ===============================
FAILED tests/test_my_model.py::test_b_str - Failed: DID NOT RAISE <class 'pydantic.e...
============================= 1 failed, 3 passed in 0.04s =============================
```
### Example Code
```Python
from pydantic import BaseModel, StrictBytes, Field
class Model(BaseModel):
a: StrictBytes = Field(...)
b: StrictBytes = Field(..., max_length=5)
m = Model(a=b'arthur', b=123) # does not raise
```
### Python, Pydantic & OS Version
```Text
pydantic version: 1.9.2
pydantic compiled: True
install path: /home/arthurazs/.cache/pypoetry/virtualenvs/asd-8JLwExQw-py3.10/lib/python3.10/site-packages/pydantic
python version: 3.10.6 (main, Aug 2 2022, 15:11:28) [GCC 9.4.0]
platform: Linux-5.15.0-46-generic-x86_64-with-glibc2.31
optional deps. installed: ['typing-extensions']
```
### Affected Components
- [ ] [Compatibility between releases](https://pydantic-docs.helpmanual.io/changelog/)
- [X] [Data validation/parsing](https://pydantic-docs.helpmanual.io/usage/models/#basic-model-usage)
- [ ] [Data serialization](https://pydantic-docs.helpmanual.io/usage/exporting_models/) - `.dict()` and `.json()`
- [ ] [JSON Schema](https://pydantic-docs.helpmanual.io/usage/schema/)
- [ ] [Dataclasses](https://pydantic-docs.helpmanual.io/usage/dataclasses/)
- [ ] [Model Config](https://pydantic-docs.helpmanual.io/usage/model_config/)
- [X] [Field Types](https://pydantic-docs.helpmanual.io/usage/types/) - adding or changing a particular data type
- [ ] [Function validation decorator](https://pydantic-docs.helpmanual.io/usage/validation_decorator/)
- [ ] [Generic Models](https://pydantic-docs.helpmanual.io/usage/models/#generic-models)
- [ ] [Other Model behaviour](https://pydantic-docs.helpmanual.io/usage/models/) - `construct()`, pickling, private attributes, ORM mode
- [ ] [Settings Management](https://pydantic-docs.helpmanual.io/usage/settings/)
- [ ] [Plugins](https://pydantic-docs.helpmanual.io/) and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.
author:
url:https://github.com/arthurazs
type:Person
name:arthurazs
datePublished:2022-08-15T21:06:05.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:2
url:https://github.com/4380/pydantic/issues/4380
Person:
url:https://github.com/arthurazs
name:arthurazs
url:https://github.com/arthurazs
name:arthurazs
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:2
interactionType:https://schema.org/CommentAction
userInteractionCount:2
External Links {π}(17)
- https://github.blog's revenue stream
- What's the income generated by https://pydantic-docs.helpmanual.io each month?
- https://fastapi.tiangolo.com's revenue stream
- Discover the revenue of https://mypy.readthedocs.io/en/stable
- How much profit does https://pydantic-docs.helpmanual.io/changelog/ generate?
- How much profit does https://pydantic-docs.helpmanual.io/usage/models/#basic-model-usage make?
- How much does https://pydantic-docs.helpmanual.io/usage/exporting_models/ pull in monthly?
- How much revenue does https://pydantic-docs.helpmanual.io/usage/schema/ produce monthly?
- How much revenue does https://pydantic-docs.helpmanual.io/usage/dataclasses/ bring in?
- What's the income generated by https://pydantic-docs.helpmanual.io/usage/model_config/ each month?
- How much profit does https://pydantic-docs.helpmanual.io/usage/types/ make?
- What's https://pydantic-docs.helpmanual.io/usage/validation_decorator/'s gross income?
- https://pydantic-docs.helpmanual.io/usage/models/#generic-models's financial summary
- https://pydantic-docs.helpmanual.io/usage/models/'s revenue stream
- What's the financial outcome of https://pydantic-docs.helpmanual.io/usage/settings/?
- What's the financial intake of https://pydantic-docs.helpmanual.io/?
- Explore the financials of https://www.githubstatus.com/
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net