instance_id stringlengths 10 57 | file_changes listlengths 1 15 | repo stringlengths 7 53 | base_commit stringlengths 40 40 | problem_statement stringlengths 11 52.5k | patch stringlengths 251 7.06M |
|---|---|---|---|---|---|
marshmallow-code__flask-smorest-409 | [
{
"changes": {
"added_entities": [
"flask_smorest/spec/__init__.py:delimited_list2param"
],
"added_modules": [
"flask_smorest/spec/__init__.py:delimited_list2param"
],
"edited_entities": [
"flask_smorest/spec/__init__.py:APISpecMixin._init_spec"
],
... | marshmallow-code/flask-smorest | 710e1f5bfa9dacdba3e0f561f9ec64edb71bfe78 | Unexpected behaviour for webargs.fields.DelimitedList
Taking the following schema:
```python
from marshmallow import Schema
from webargs import fields
class MyScghema(Schema):
a = fields.String()
b = fields.String()
sort_by = fields.DelimitedList(fields.String())
```
According to [Webargs](ht... | diff --git a/flask_smorest/spec/__init__.py b/flask_smorest/spec/__init__.py
index cb43dbf..76e8351 100644
--- a/flask_smorest/spec/__init__.py
+++ b/flask_smorest/spec/__init__.py
@@ -7,6 +7,7 @@ from flask import current_app
import click
import apispec
from apispec.ext.marshmallow import MarshmallowPlugin
+from we... |
marshmallow-code__flask-smorest-561 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "flask_smorest/etag.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"flask_smorest/... | marshmallow-code/flask-smorest | 50216078382efe9fca01b55ca7df157301b27215 | Apispec 6.1.0: Accessing API docs throws TypeError: Object of type Decimal is not JSON serializable
The update to 6.1.0 causes an 500 internal server error for me when trying to view my API docs in a browser. Using flask-smorest. No such error in 6.0.2.
Traceback (most recent call last):
File "/usr/local/lib/p... | diff --git a/flask_smorest/etag.py b/flask_smorest/etag.py
index 0a3bc0e..5fcef90 100644
--- a/flask_smorest/etag.py
+++ b/flask_smorest/etag.py
@@ -2,13 +2,12 @@
from functools import wraps
from copy import deepcopy
-import json
import http
import warnings
import hashlib
-from flask import request
+from fla... |
marshmallow-code__marshmallow-1002 | [
{
"changes": {
"added_entities": [
"marshmallow/fields.py:DateTime._make_object_from_format",
"marshmallow/fields.py:Date._make_object_from_format"
],
"added_modules": null,
"edited_entities": [
"marshmallow/fields.py:DateTime._create_data_object_from_parsed_value... | marshmallow-code/marshmallow | 74854d37376b5c9ca0b52d87bd9d3600b820a1a3 | fields.Date deserialize resulting in datetime
Today I moved from 3.0.0b16 to 3.0.0b17 since I wanted the `format` option for `fields.Date` ([this commit](https://github.com/marshmallow-code/marshmallow/commit/8efb79a8ed45906853c53335b0ca1b36e8528208)). However I'm getting some unexpected results:
>>> import mars... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index bf80e7dc..4f6a064f 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,11 @@ Changelog
3.0.0b18 (unreleased)
+++++++++++++++++++++
+Bug fixes:
+
+- Fix ``Date`` deserialization when using custom format (:issue:`1001`). Thanks
+ :user:`Ondkloss` for reporting.
... |
marshmallow-code__marshmallow-1036 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/class_registry.py:register"
],
"edited_modules": [
"marshmallow/class_registry.py:register"
]
},
"file": "marshmallow/class_registry.py"
}
] | marshmallow-code/marshmallow | 45ef0512120520ee679875861e5c5cdacc16f8bf | memory leak occurs when creating a new type
When I use the following code, I observe that memory leak is very fast
**MsgSchema = type('MsgSchema', (marshmallow.Schema,), {})**
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import marshmallow
import time
import psutil
import os
if __name__ == '__main__... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index d4eabed8..42b0f04b 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -87,3 +87,4 @@ Contributors (chronological)
- Maxim Novikov `@m-novikov <https://github.com/m-novikov>`_
- Viktor Kerkez `@alefnula <https://github.com/alefnula>`_
- Jan Margeta `@jmargeta <https://github.co... |
marshmallow-code__marshmallow-1063 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/utils.py:_get_value_for_key"
],
"edited_modules": [
"marshmallow/utils.py:_get_value_for_key"
]
},
"file": "marshmallow/utils.py"
}
] | marshmallow-code/marshmallow | 55932fa4e4ba7496f424ed2942d7963051030699 | Marshmallow 3 can't dump dict-likes with property
I'm trying to port [umongo](https://github.com/Scille/umongo) to marshmallow 3 and I stumbled upon this:
```py
import marshmallow as ma
class MyDict(dict):
@property
def prop(self):
return 12
class MySchema(ma.Schema):
prop = ma.fie... | diff --git a/marshmallow/utils.py b/marshmallow/utils.py
index 909d00ab..49b1c336 100644
--- a/marshmallow/utils.py
+++ b/marshmallow/utils.py
@@ -362,12 +362,13 @@ def _get_value_for_keys(obj, keys, default):
def _get_value_for_key(obj, key, default):
+ if not hasattr(obj, '__getitem__'):
+ return getat... |
marshmallow-code__marshmallow-1067 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/schema.py:BaseSchema.__init__",
"marshmallow/schema.py:BaseSchema._deserialize"
],
"edited_modules": [
"marshmallow/schema.py:BaseSchema"
]
},
"file... | marshmallow-code/marshmallow | 4dc6b656ec61e0a1f945aaf20bc43673ec0c01f6 | Make the error messages for "unknown fields" and "invalid data type" configurable
As a follow-up to https://github.com/marshmallow-code/marshmallow/pull/838#issuecomment-399677937 : Make the error messages for passing unknown fields (currently `'Unknown field.'`) and invalid input type (currently `'Invalid input type.'... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index f1f23ff6..f3933100 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -115,4 +115,5 @@ Contributors (chronological)
- Jan Margeta `@jmargeta <https://github.com/jmargeta>`_
- AlexV `@asmodehn <https://github.com/asmodehn>`_
- `@toffan <https://github.com/toffan>`_
+- Hampus Du... |
marshmallow-code__marshmallow-1078 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/fields.py:Field.__init__"
],
"edited_modules": [
"marshmallow/fields.py:Field"
]
},
"file": "marshmallow/fields.py"
}
] | marshmallow-code/marshmallow | ebf7564b1551cc93df3f6705ac77b2b3b67b5917 | How to deal with a field with both required and missing?
@taion (https://github.com/marshmallow-code/marshmallow/pull/756#issuecomment-436054072):
> [Since #756], missing now has no effect if required is specified, as the required check is made before the missing logic is applied.
>
> I think it would make more sens... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index bb0fe839..e1b90723 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -15,6 +15,8 @@ Other changes:
- Add ``marshmallow.__version_info__`` (:pr:`1074`).
- Remove the ``marshmallow.marshalling`` internal module (:pr:`1070`).
+- A ``ValueError`` is raised when the ``mis... |
marshmallow-code__marshmallow-1079 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/schema.py:SchemaMeta.__init__",
"marshmallow/schema.py:SchemaOpts.__init__"
],
"edited_modules": [
"marshmallow/schema.py:SchemaMeta",
"marshmallow/schema... | marshmallow-code/marshmallow | 09855418261af6faa74764b0af3a90944ab673c6 | Proposal: Add a class Meta option to prevent adding a class to the internal registry
## Purpose
Implement a way to bypass marshmallow's internal class registry when it isn't necessary in order to optimize memory usage.
## Proposed API
```python
class MyNonRegisteredSchema(Schema):
class Meta:
... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index e1b90723..b632a083 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,11 @@ Changelog
3.0.0rc2 (unreleased)
+++++++++++++++++++++
+Features:
+
+- Add ``register`` *class Meta* option to allow bypassing marshmallow's
+ internal class registry when memory usage... |
marshmallow-code__marshmallow-1142 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:FormattedString.__init__",
"src/marshmallow/fields.py:FormattedString._serialize"
],
"edited_modules": [
"src/marshmallow/fields.py:FormattedString"... | marshmallow-code/marshmallow | cfb09de0c3048e1c416ba7f34b7b703c6098003f | RFC: Remove FormattedString field
`fields.FormattedString` only exists because it was [ported from Flask-RESTful](https://github.com/flask-restful/flask-restful/blob/b30a408b64acd167cba3a09e649d6c97e415af6b/flask_restful/fields.py#L250). It has a couple peculiarities:
1. It [converts the object to a dict](https://gi... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index e3c2c121..ba309a43 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -9,6 +9,11 @@ Features:
- Allow input value to be included in error messages
for a number of fields (:pr:`1129`). Thanks :user:`hdoupe` for the PR.
+Deprecations/Removals:
+
+- Remove ``fields.For... |
marshmallow-code__marshmallow-1164 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Nested._serialize"
],
"edited_modules": [
"src/marshmallow/fields.py:Nested"
]
},
"file": "src/marshmallow/fields.py"
},
{
"changes": ... | marshmallow-code/marshmallow | 1e26d14facab213df5009300b997481aa43df80a | 2.x: Nested(many=True) eats first element from generator value when dumping
As reproduced in Python 3.6.8:
```py
from marshmallow import Schema, fields
class O(Schema):
i = fields.Int()
class P(Schema):
os = fields.Nested(O, many=True)
def gen():
yield {'i': 1}
yield {'i': 0}
p = P()... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index 2892e5c3..9eecb9f5 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -89,3 +89,4 @@ Contributors (chronological)
- Jan Margeta `@jmargeta <https://github.com/jmargeta>`_
- AlexV `@asmodehn <https://github.com/asmodehn>`_
- `@miniscruff <https://github.com/miniscruff>`_
+- Kim... |
marshmallow-code__marshmallow-1220 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"examples/flask_example.py:QuoteSchema.process_author"
],
"edited_modules": [
"examples/flask_example.py:QuoteSchema"
]
},
"file": "examples/flask_example.py"
},
{
... | marshmallow-code/marshmallow | 2798a8d748ad9fdb20a85aff66c07e433773ef1d | Accessing partial within validates_schema
It does not look like there is a way for a function decorated with `validates_schema` to know if the schema is `load`ing with `partial=True`. This information is important in determining for example if certain validations should be skipped (ie if they involve combinations of fi... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index c417279e..c55d7148 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,6 +6,11 @@ Changelog
Features:
+- *Backwards-incompatible*: ``many`` is passed as a keyword argument to methods decorated with
+ ``pre_load``, ``post_load``, ``pre_dump``, ``post_dump``,
+ and... |
marshmallow-code__marshmallow-1229 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:List.__init__",
"src/marshmallow/fields.py:List._bind_to_schema",
"src/marshmallow/fields.py:Tuple._bind_to_schema",
"src/marshmallow/fields.py:Mapping.... | marshmallow-code/marshmallow | 456bacbbead4fa30a1a82892c9446ac9efb8055b | `only` argument inconsistent between Nested(S, many=True) and List(Nested(S))
```python
from pprint import pprint
from marshmallow import Schema
from marshmallow.fields import Integer, List, Nested, String
class Child(Schema):
name = String()
age = Integer()
class Family(Schema):
children ... | diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py
index 2eec1256..103f5892 100644
--- a/src/marshmallow/fields.py
+++ b/src/marshmallow/fields.py
@@ -576,12 +576,18 @@ class List(Field):
'The list elements must be a subclass or instance of '
'marshmallow.base.FieldABC.... |
marshmallow-code__marshmallow-1238 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/schema.py:BaseSchema.__init__",
"src/marshmallow/schema.py:BaseSchema._normalize_nested_options",
"src/marshmallow/schema.py:BaseSchema._update_fields"
],
"ed... | marshmallow-code/marshmallow | ac9ff95432f929fb0fa2394c29b94d1f804a1504 | Defining fields with dot notations in Meta.exclude only works when initialising first time
Demonstration of the issue
``` python
from marshmallow import Schema, fields
class AuthorSchema(Schema):
first_name = fields.String(required=True)
last_name = fields.String(required=True)
class BaseSchema(Sc... | diff --git a/src/marshmallow/schema.py b/src/marshmallow/schema.py
index b370035d..085c509b 100644
--- a/src/marshmallow/schema.py
+++ b/src/marshmallow/schema.py
@@ -346,7 +346,7 @@ class BaseSchema(base.SchemaABC):
self.declared_fields = copy.deepcopy(self._declared_fields)
self.many = many
... |
marshmallow-code__marshmallow-1249 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/utils.py:from_iso"
],
"edited_modules": [
"src/marshmallow/utils.py:from_iso"
]
},
"file": "src/marshmallow/utils.py"
}
] | marshmallow-code/marshmallow | ae55b27a8fb9124d1486baf87286d501014f06b1 | DateTime loses microseconds on deserialization if dateutil is not installed
```py
fields.DateTime().deserialize('2019-02-22T17:56:43.820462')
datetime.datetime(2019, 2, 22, 17, 56, 43)
```
This is obvious in the last line of `from_iso_datetime`:
```py
def from_iso_datetime(datetimestring, use_dateutil=True):
... | diff --git a/src/marshmallow/utils.py b/src/marshmallow/utils.py
index 42458a6f..113906d6 100755
--- a/src/marshmallow/utils.py
+++ b/src/marshmallow/utils.py
@@ -283,6 +283,9 @@ def from_iso(datestring, use_dateutil=True):
return parser.parse(datestring)
else:
# Strip off timezone info.
+ ... |
marshmallow-code__marshmallow-1252 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/utils.py:from_iso"
],
"edited_modules": [
"src/marshmallow/utils.py:from_iso"
]
},
"file": "src/marshmallow/utils.py"
}
] | marshmallow-code/marshmallow | b063a103ae5222a5953cd7453a1eb0d161dc5b52 | ISO8601 DateTimes ending with Z considered not valid in 2.19.4
Probably related to #1247 and #1234 - in marshmallow `2.19.4`, with `python-dateutil` _not_ installed, it seems that loading a datetime in ISO8601 that ends in `Z` (UTC time) results in an error:
```python
class Foo(Schema):
date = DateTime(require... | diff --git a/src/marshmallow/utils.py b/src/marshmallow/utils.py
index 113906d6..87bba69c 100755
--- a/src/marshmallow/utils.py
+++ b/src/marshmallow/utils.py
@@ -285,6 +285,9 @@ def from_iso(datestring, use_dateutil=True):
# Strip off timezone info.
if '.' in datestring:
# datestring con... |
marshmallow-code__marshmallow-1278 | [
{
"changes": {
"added_entities": [
"src/marshmallow/fields.py:NaiveDateTime.__init__",
"src/marshmallow/fields.py:NaiveDateTime._deserialize",
"src/marshmallow/fields.py:AwareDateTime.__init__",
"src/marshmallow/fields.py:AwareDateTime._deserialize"
],
"added_mo... | marshmallow-code/marshmallow | 3142423fba0bfb3bf6690671ff41eef4e811ae25 | DateTime timezone management rework
There are various issues I'd like to address in `DateTime` timezone management.
- ~Different behaviour depending on whether dateutil is installed (https://github.com/marshmallow-code/marshmallow/issues/497). Explicit would be better than implicit.~ (Fixed in #1265)
- Awareness no... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8e2fd474..a05acd32 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,16 @@ Changelog
3.0.0 (unreleased)
++++++++++++++++++
+Features:
+
+- *Backwards-incompatible*: ``DateTime`` does not affect timezone information
+ on serialization and deserialization.
+- ... |
marshmallow-code__marshmallow-1304 | [
{
"changes": {
"added_entities": [
"src/marshmallow/fields.py:Integer._validated",
"src/marshmallow/fields.py:Float._validated"
],
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Nested._serialize",
"src/marshmallow/fields.py:Number.... | marshmallow-code/marshmallow | 70d95e1c44b9838ed4042f636ac71ad65ad9e522 | Remove validation on serialization
When using `Dict(values=Nested())` I expect errors in dictionary values to be nested in such a way that I can locate exactly what element is causing the problem. This seems to work as expected for `load()`, but not for `dump()`.
Minimal example:
- Marshmallow version: 3.0.0rc4
... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 5a0a27a4..2512ff20 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,6 +6,8 @@ Changelog
Features:
+- *Backwards-incompatible*: Validation does not occur on serialization (:issue:`1132`).
+ This significantly improves serialization performance.
- *Backwards-inc... |
marshmallow-code__marshmallow-1322 | [
{
"changes": {
"added_entities": [
"src/marshmallow/schema.py:BaseSchema.from_dict"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"src/marshmallow/schema.py:BaseSchema"
]
},
"file": "src/marshmallow/schema.py"
}
] | marshmallow-code/marshmallow | 51238065d87d788532e50894ea52dafee1c97753 | Add a way to generate a Schema from a dictionary
Generating schemas at runtime is a fairly common use case that I've run into a handful of times at this point ([webargs](https://github.com/marshmallow-code/webargs/blob/de061e037285fd08a42d73be95bc779f2a4e3c47/src/webargs/core.py#L50-L63), [environs](https://github.com/... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 1784bcf0..86586ec4 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -8,6 +8,7 @@ Features:
- Optimize ``List(Nested(...))`` (:issue:`779`).
- Minor performance improvements and cleanup (:pr:`1328`).
+- Add ``Schema.from_dict`` (:issue:`1312`).
Deprecations/Remova... |
marshmallow-code__marshmallow-1343 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/schema.py:BaseSchema._invoke_field_validators"
],
"edited_modules": [
"src/marshmallow/schema.py:BaseSchema"
]
},
"file": "src/marshmallow/schema.py"
... | marshmallow-code/marshmallow | 2be2d83a1a9a6d3d9b85804f3ab545cecc409bb0 | [version 2.20.0] TypeError: 'NoneType' object is not subscriptable
After update from version 2.19.5 to 2.20.0 I got error for code like:
```python
from marshmallow import Schema, fields, validates
class Bar(Schema):
value = fields.String()
@validates('value') # <- issue here
def validate_valu... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index d8c8d2d8..5f6427c6 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
Changelog
---------
+2.20.1 (unreleased)
+*******************
+
+Bug fixes:
+
+- Fix bug that raised ``TypeError`` when invalid data type is
+ passed to a nested schema with ``@valida... |
marshmallow-code__marshmallow-1359 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:DateTime._bind_to_schema"
],
"edited_modules": [
"src/marshmallow/fields.py:DateTime"
]
},
"file": "src/marshmallow/fields.py"
}
] | marshmallow-code/marshmallow | b40a0f4e33823e6d0f341f7e8684e359a99060d1 | 3.0: DateTime fields cannot be used as inner field for List or Tuple fields
Between releases 3.0.0rc8 and 3.0.0rc9, `DateTime` fields have started throwing an error when being instantiated as inner fields of container fields like `List` or `Tuple`. The snippet below works in <=3.0.0rc8 and throws the error below in >=3... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 661f0288..3755e8b3 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
Changelog
---------
+3.0.1 (unreleased)
+++++++++++++++++++
+
+Bug fixes:
+
+- Fix bug when nesting ``fields.DateTime`` within ``fields.List()`` or ``fields.Tuple`` (:issue:`1357`).
+ ... |
marshmallow-code__marshmallow-1379 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/schema.py:BaseSchema._serialize",
"src/marshmallow/schema.py:BaseSchema._deserialize",
"src/marshmallow/schema.py:BaseSchema._init_fields",
"src/marshmallow/schem... | marshmallow-code/marshmallow | 34edef41d53d73791b54e514006349045829ca45 | Empty string data_key disallowed
Having an empty string as `data_key` doesn't seem to work.
```py
import marshmallow
from marshmallow import fields
class RootSchema(marshmallow.Schema):
x = fields.Raw(data_key="")
RootSchema().load({'': 1})
```
```py
---> 14 RootSchema().load({'': 1})
~/.p... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 002562ee..60ea4ee9 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
Changelog
---------
+3.0.3 (unreleased)
+++++++++++++++++++
+
+Bug fixes:
+
+- Handle when ``data_key`` is an empty string (:issue:`1378`).
+ Thanks :user:`jtrakk` for reporting.
+
3... |
marshmallow-code__marshmallow-1382 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"examples/peewee_example.py:TodoSchema"
]
},
"file": "examples/peewee_example.py"
},
{
"changes": {
"added_entities": null,
"added_modules"... | marshmallow-code/marshmallow | e06e9ca3aac1b7389eda488b0627340c5cb3782d | How to pass parameters to a nested schema which is referred by name
I would like to refer to a schema by its name when I use it as a nested one, but still I'd like to pass custom arguments to its constructor.
For example instead of doing this:
```python
class AuthorSchema(Schema):
books = fields.Nested(BookSc... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 15993b2c..1a4e0ed8 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,12 +1,63 @@
Changelog
---------
+3.3.0 (unreleased)
+******************
+
+Features:
+
+- ``fields.Nested`` may take a callable that returns a schema instance.
+ Use this to resolve order-of-dec... |
marshmallow-code__marshmallow-1385 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Nested.schema"
],
"edited_modules": [
"src/marshmallow/fields.py:Nested"
]
},
"file": "src/marshmallow/fields.py"
},
{
"changes": {
... | marshmallow-code/marshmallow | 8b3a32614fd4a74e93e9a63a042e74c1fea34466 | Dotted `only` and `exclude` not working for nested schema instances
#1229 fixed propagation of `only` and `exclude` for nested schema classes but no instances.
Dotted strings passed to `only` and `exclude` are not respected when a schema instance is nested.
```python
from marshmallow import Schema, fields
c... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 5d010b98..f547143c 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
Changelog
---------
+3.0.4 (unreleased)
+++++++++++++++++++
+
+Bug fixes:
+
+- Fix propagating dot-delimited `only` and `exclude` parameters to nested schema instances (:issue:`1384`).... |
marshmallow-code__marshmallow-1401 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Url.__init__",
"src/marshmallow/fields.py:Email.__init__"
],
"edited_modules": [
"src/marshmallow/fields.py:Url",
"src/marshmallow/fields.py... | marshmallow-code/marshmallow | 8e217c8d6fefb7049ab3389f31a8d35824fa2d96 | Uncaught error when passing non-list validators to Email and URL fields
`fields.Email` and `fields.URL` error if a non-list is passed to `validate`.
```python
from marshmallow import Schema, fields, validate
class UserSchema(Schema):
email = fields.Email(validate=(validate.Length(min=5), ))
url = field... | diff --git a/.gitignore b/.gitignore
index 150127b5..9a31971a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -73,3 +73,8 @@ venv
# Other
.directory
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index ae3914e2..a9a07809 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6... |
marshmallow-code__marshmallow-1405 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Nested.schema"
],
"edited_modules": [
"src/marshmallow/fields.py:Nested"
]
},
"file": "src/marshmallow/fields.py"
}
] | marshmallow-code/marshmallow | 116af59eb13c4bcf7493c2676f955c882f05de8c | Error when unpickleable object in nested schema's context
> I have nested schema instance which context contains non-pickling object. In my case it is `Crypto.Cipher.AES` object which i tried to deepcopy in console and got an error.
_Originally posted by @metheoryt in https://github.com/marshmallow-code/marshmallow... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index ccd53e4b..90db286b 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -8,6 +8,8 @@ Bug fixes:
- Restore inheritance hierarchy of ``Number`` fields (:pr:`1403`).
``fields.Integer`` and ``fields.Decimal`` inherit from ``fields.Number``.
+- Fix bug that raised an uncau... |
marshmallow-code__marshmallow-1503 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "setup.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:F... | marshmallow-code/marshmallow | 9146621c696a81446fc0c6fbab4dc071cb72d5f8 | Regression on list of nullable nested fields
Hello,
While porting some code from 2.20 to 3.3, I stumbled upon this change in behavior regarding list of nullable fields.
in 2.20 the following code works:
```python
from marshmallow import fields, Schema
class S(Schema):
f = fields.List(fields.Nested(Schem... | diff --git a/setup.py b/setup.py
index 370b0467..951594ca 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ EXTRAS_REQUIRE = {
"pre-commit>=1.20,<3.0",
],
"docs": [
- "sphinx==2.4.0",
+ "sphinx==2.3.1",
"sphinx-issues==1.2.0",
"alabaster==0.7.12",
"sphinx... |
marshmallow-code__marshmallow-1524 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"src/marshmallow/validate.py:URL",
"src/marshmallow/validate.py:Email"
]
},
"file": "src/marshmallow/validate.py"
}
] | marshmallow-code/marshmallow | 7015fc4333a2f32cd58c3465296e834acd4496ff | Incorrect Email Validation
https://github.com/marshmallow-code/marshmallow/blob/fbe22eb47db5df64b2c4133f9a5cb6c6920e8dd2/src/marshmallow/validate.py#L136-L151
The email validation regex will match `email@domain.com\n`, `email\n@domain.com`, and `email\n@domain.com\n`.
The issue is that `$` is used to match until ... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index 02678948..cabe5ad9 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -92,3 +92,4 @@ Contributors (chronological)
- Kim Gustyr `@khvn26 <https://github.com/khvn26>`_
- Bryce Drennan `@brycedrennan <https://github.com/brycedrennan>`_
- Cristi Scoarta `@cristi23 <https://github.... |
marshmallow-code__marshmallow-168 | [
{
"changes": {
"added_entities": [
"marshmallow/exceptions.py:MarshallingError.__init__",
"marshmallow/exceptions.py:UnmarshallingError.__init__"
],
"added_modules": null,
"edited_entities": [
"marshmallow/exceptions.py:_WrappingException.__init__",
"marsh... | marshmallow-code/marshmallow | 4748220fc19c2b7389a1f3474e123fe285154538 | Remove MarshallingError and UnmarshallingError in favor of a single ValidationError
Currently, `MarshallingError` and `UnmarshallingError` signal that an error should be stored in the `errors` dictionary during marshalling and unmarshalling.
These exceptions only served a purpose prior to commit https://github.com/... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 81840c5e..589c12fe 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,8 +6,9 @@ Changelog
Features:
-- *Backwards-incompatible*: When ``many=True``, the errors dictionary returned by ``dump`` and ``load`` will be keyed on the indices of invalid items in the (de)se... |
marshmallow-code__marshmallow-1682 | [
{
"changes": {
"added_entities": [
"src/marshmallow/fields.py:Time._make_object_from_format"
],
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Time._serialize",
"src/marshmallow/fields.py:Time._deserialize"
],
"edited_modules": ... | marshmallow-code/marshmallow | f37da1abf5a32e9f3823ae446b75a104000aa0a8 | Add format option for fields.time
ISO 8601 supports following formats:
> hh:mm:ss.sss or hhmmss.sss
> hh:mm:ss or hhmmss
> hh:mm or hhmm
> hh
It would be nice to have a format option for fields.time, like
`begin = fields.Time(format='hh:mm')`
| diff --git a/AUTHORS.rst b/AUTHORS.rst
index 40899ce3..417b62a5 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -155,3 +155,4 @@ Contributors (chronological)
- `@ebargtuo <https://github.com/ebargtuo>`_
- Michał Getka `@mgetka <https://github.com/mgetka>`_
- Nadège Michel `@nadege <https://github.com/nadege>`_
+- Tama... |
marshmallow-code__marshmallow-1702 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "setup.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:F... | marshmallow-code/marshmallow | fa6c7379468f59d4568e29cbbeb06b797d656215 | RFC: Change the way we store metadata?
Users are often bit by the fact that fields store arbitrary keyword arguments as metadata. See https://github.com/marshmallow-code/marshmallow/issues/683.
> ...The reasons we use **kwargs instead of e.g. `metadata=` are mostly historical. The original decision was that storing ... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 818dfd44..ab5cc824 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,15 @@
Changelog
---------
+3.10.0 (Unreleased)
+*******************
+
+Deprecations:
+
+- Passing field metadata via keyword arguments is deprecated and will be
+ removed in marshmallow 4 (... |
marshmallow-code__marshmallow-1745 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/schema.py:Schema._deserialize"
],
"edited_modules": [
"src/marshmallow/schema.py:Schema"
]
},
"file": "src/marshmallow/schema.py"
}
] | marshmallow-code/marshmallow | b297db947282c1c1dbef2d1ab35830a87daa421f | JSON deserialization converts dots in field names to deep dictionaries.
**Summary**
The marshmallow JSON deserializer interprets dots as meaning a sub-object in user-provided input, violating the JSON standard.
**Minimal example**
```py
from marshmallow import Schema, INCLUDE
class MySchema(Schema):
class... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 18f514e2..1b796e22 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
Changelog
---------
+3.11.1 (unreleased)
+*******************
+
+Bug fixes:
+
+- Fix treatment of dotted keys when unknown=INCLUDE (:issue:`1506`).
+ Thanks :user:`rbu` for reporting ... |
marshmallow-code__marshmallow-1777 | [
{
"changes": {
"added_entities": [
"src/marshmallow/fields.py:Field._validate_all"
],
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Field._validate"
],
"edited_modules": [
"src/marshmallow/fields.py:Field"
]
},
"f... | marshmallow-code/marshmallow | 1be1b0cd7cacb42b0d547c3e9bc0d94704bbed1e | And validator
Hello everyone!
I would like to add a new validator to combine multiple validators into one. Simple example:
```py
def calculate_age(birthday: date) -> int:
today = date.today()
offset = (today.month, today.day) < (birthday.month, birthday.day)
return today.year - birthday.year - offse... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 93218bac..261ba45a 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,6 +6,8 @@ Changelog
Features:
+- Add ``validate.And`` (:issue:`1768`).
+ Thanks :user:`rugleb` for the suggestion.
- Let ``Field``s be accessed by name as ``Schema`` attributes (:pr:`1631`).
... |
marshmallow-code__marshmallow-1810 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"src/marshmallow/base.py:FieldABC"
]
},
"file": "src/marshmallow/base.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
... | marshmallow-code/marshmallow | 23d0551569d748460c504af85996451edd685371 | 3.12 no longer supports fields named `parent`
Pretty sure that #1631 broke it. Reproducible example:
```py
from marshmallow import INCLUDE
from marshmallow.fields import Nested
from sqlalchemy import Column, DATE, create_engine, ForeignKey
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm impo... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 78136223..eacdb4db 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,15 @@
Changelog
---------
+3.12.1 (unreleased)
+*******************
+
+Bug fixes:
+
+- Fix bug that raised an ``AttributeError`` when instantiating a
+ ``Schema`` with a field named ``paren... |
marshmallow-code__marshmallow-1896 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Field.__init__"
],
"edited_modules": [
"src/marshmallow/fields.py:Field"
]
},
"file": "src/marshmallow/fields.py"
},
{
"changes": {
... | marshmallow-code/marshmallow | 6bbbabc02214cd6b49af85f1a883249c3c8d8e75 | [RFC] set_class = OrderedSet by default?
I assume the performance impact would be minimal. From a quick look, it would only affect schema instantiation.
The benefit is that when using Python 3.7+, all schemas would be ordered. They still wouldn't return `OrderedDict` instances unless `ordered` Meta is passed, but th... | diff --git a/docs/quickstart.rst b/docs/quickstart.rst
index 7d106228..c6bc2426 100644
--- a/docs/quickstart.rst
+++ b/docs/quickstart.rst
@@ -524,37 +524,6 @@ Note that ``name`` will be automatically formatted as a :class:`String <marshmal
# No need to include 'uppername'
additional =... |
marshmallow-code__marshmallow-1989 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/schema.py:SchemaOpts.__init__",
"src/marshmallow/schema.py:Schema.__init__",
"src/marshmallow/schema.py:Schema._do_load"
],
"edited_modules": [
"src/m... | marshmallow-code/marshmallow | 66e45e172e8c055ebc3f76ebec592ac7e79f4820 | Is it intentional that setting parameter unknown=<any non-empty string> behaves the same as unknown=EXCLUDE?
I was playing around with some of the unknown options and noticed that if you set unknown to a random string when instantiating a schema, it behaves the same as setting `unknown=EXCLUDE`.
Is this intentional?... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 77922a0a..73008f7b 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,11 @@ Changelog
(unreleased)
************
+Features:
+
+- Raise `ValueError` if an invalid value is passed to the ``unknown`` argument (:issue:`1721`, :issue:`1732`).
+ Thanks :user:`sirose... |
marshmallow-code__marshmallow-2123 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Url.__init__"
],
"edited_modules": [
"src/marshmallow/fields.py:Url"
]
},
"file": "src/marshmallow/fields.py"
},
{
"changes": {
... | marshmallow-code/marshmallow | 5a10e83c557d2ee97799c2b85bec49fc90381656 | fields.URL should allow relative-only validation
Relative URLs may be used to redirect the user within the site, such as to sign in, and allowing absolute URLs without extra validation opens up a possibility of nefarious redirects.
Current `fields.URL(relative = True)` allows relative URLs _in addition_ to absolute ... | diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py
index 386aa7c3..445d1c73 100644
--- a/src/marshmallow/fields.py
+++ b/src/marshmallow/fields.py
@@ -1710,6 +1710,7 @@ class Url(String):
self,
*,
relative: bool = False,
+ absolute: bool = True,
schemes: types.... |
marshmallow-code__marshmallow-2150 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/schema.py:Schema.__init__",
"src/marshmallow/schema.py:Schema._deserialize",
"src/marshmallow/schema.py:Schema._invoke_load_processors",
"src/marshmallow/schema.p... | marshmallow-code/marshmallow | 819749204b9a7271c189401e5f5aa00cab624514 | Nested partial not working as expected
When using partial in Nested field it does not work.
Problem is because Nested gets partial from parent class that is False as default parameter on schema constructor.
So the Nested class gets partial=False in deserialize:
https://github.com/marshmallow-code/marshmallow/blob/... | diff --git a/src/marshmallow/schema.py b/src/marshmallow/schema.py
index cde8c080..4e7fd828 100644
--- a/src/marshmallow/schema.py
+++ b/src/marshmallow/schema.py
@@ -374,7 +374,7 @@ class Schema(base.SchemaABC, metaclass=SchemaMeta):
context: dict | None = None,
load_only: types.StrSequenceOrSet = ()... |
marshmallow-code__marshmallow-2229 | [
{
"changes": {
"added_entities": [
"src/marshmallow/__init__.py:__getattr__"
],
"added_modules": [
"src/marshmallow/__init__.py:__getattr__"
],
"edited_entities": null,
"edited_modules": null
},
"file": "src/marshmallow/__init__.py"
}
] | marshmallow-code/marshmallow | 334b17a17a081576155eabdababe9347e7f5d689 | Deprecate __version__ and related attributes
See https://github.com/pallets/flask/issues/5230 for rationale and the linked PR for implementation.
Additionally, this will allow us to remove `packaging` as a dependency | diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 3f590c73..a04147ca 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -5,10 +5,7 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
- ignore:
- - dependency-name: sphinx
- versions:
- - 3.5.0
- - 3.... |
marshmallow-code__marshmallow-2252 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"examples/flask_example.py:new_quote"
],
"edited_modules": [
"examples/flask_example.py:new_quote"
]
},
"file": "examples/flask_example.py"
},
{
"changes": {
... | marshmallow-code/marshmallow | f511f5dd1b2506183fa4c601340a5301057a349d | Address deprecation warnings in tests
A number of these warnings appear when running the tests in Python 3.12:
```
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC)... | diff --git a/examples/flask_example.py b/examples/flask_example.py
index 0d8b9e8d..69a1520d 100644
--- a/examples/flask_example.py
+++ b/examples/flask_example.py
@@ -128,7 +128,9 @@ def new_quote():
db.session.add(author)
# Create new quote
quote = Quote(
- content=data["content"], author=aut... |
marshmallow-code__marshmallow-2264 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:DateTime._deserialize"
],
"edited_modules": [
"src/marshmallow/fields.py:DateTime"
]
},
"file": "src/marshmallow/fields.py"
},
{
"chan... | marshmallow-code/marshmallow | 183c411ce44ff97f4e75800b20f46be388392ba7 | timestamp 0 is not valid for DateTime('timestamp')
0 is a valid timestamp, however, an error occurs during parsing
code example:
```python
from marshmallow import fields, Schema
class A(Schema):
x = fields.DateTime('timestamp')
a = A().load({"x": 0})
print(a)
```
expected:
```python
{'x': datet... | diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py
index 42e529c9..ceb32aa9 100644
--- a/src/marshmallow/fields.py
+++ b/src/marshmallow/fields.py
@@ -1285,8 +1285,6 @@ class DateTime(Field):
return value.strftime(data_format)
def _deserialize(self, value, attr, data, **kwargs) -> dt.dat... |
marshmallow-code__marshmallow-2271 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/schema.py:SchemaOpts.__init__",
"src/marshmallow/schema.py:Schema.__init__"
],
"edited_modules": [
"src/marshmallow/schema.py:SchemaOpts",
"src/marshm... | marshmallow-code/marshmallow | c592536b649fab0bbfb4bc3f84b65577a13b8ca2 | Setting many=True through Meta - SchemaOpts
I would like to propose adding support for setting `many=True` within the `Meta` class of a schema in Marshmallow. This feature would allow developers to configure a schema to always handle lists of objects by default, streamlining schema instantiation (no need to set `many=T... | diff --git a/src/marshmallow/schema.py b/src/marshmallow/schema.py
index 4f2d0c76..99210ce7 100644
--- a/src/marshmallow/schema.py
+++ b/src/marshmallow/schema.py
@@ -227,6 +227,7 @@ class SchemaOpts:
self.dump_only = getattr(meta, "dump_only", ())
self.unknown = validate_unknown_parameter_value(getat... |
marshmallow-code__marshmallow-234 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/schema.py:BaseSchema.__filter_fields"
],
"edited_modules": [
"marshmallow/schema.py:BaseSchema"
]
},
"file": "marshmallow/schema.py"
}
] | marshmallow-code/marshmallow | 4e922445601219dc6bfe014d36b3c61d9528e2ad | fields.Nested does not support sets
Currently `fields.Nested` assumes that the value of the field is a list - https://github.com/marshmallow-code/marshmallow/blob/dev/marshmallow/schema.py#L702 - and fails for `set` during serialization | diff --git a/marshmallow/schema.py b/marshmallow/schema.py
index 4de0a123..7fe1289f 100644
--- a/marshmallow/schema.py
+++ b/marshmallow/schema.py
@@ -699,8 +699,8 @@ class BaseSchema(base.SchemaABC):
"""
if obj and many:
try: # Homogeneous collection
- obj_prototype = obj... |
marshmallow-code__marshmallow-262 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "marshmallow/__init__.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/... | marshmallow-code/marshmallow | b8ad05b5342914e857c442d75e8abe9ea8f867fb | DateTime ignores date formatting string
The documentation for the `marshmallow.fields.DateTime` says:
Parameters:
* format (str) – Either "rfc" (for RFC822), "iso" (for ISO8601), or a date format string. If None, defaults to “iso”.
But the part `or a date format string` is not true. I would've expec... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index b9a42126..26fc232f 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -40,3 +40,4 @@ Contributors (chronological)
- Kelvin Hammond `@kelvinhammond <https://github.com/kelvinhammond>`_
- Matt Stobo `@mwstobo <https://github.com/mwstobo>`_
- Max Orhai `@max-orhai <https://github... |
marshmallow-code__marshmallow-2708 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/fields.py:Field._validate_all"
],
"edited_modules": [
"src/marshmallow/fields.py:Field"
]
},
"file": "src/marshmallow/fields.py"
},
{
"changes":... | marshmallow-code/marshmallow | 4d3810ce903e54655316fb5ea74c525205fa32fe | Don't check for False return values from validators
Currently, validators are allowed to return `False` which results in `ValidationError` with a generic message.
https://github.com/marshmallow-code/marshmallow/blob/9ac3241b78b444033f901d51b431ac862d1e21cc/src/marshmallow/fields.py#L249-L251
I'm not convinced thi... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index d8747862..ee4a6c48 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,8 @@ Changelog
4.0.0 (unreleased)
******************
+See :ref:`upgrading_4_0` for a guide on updating your code.
+
- *Backwards-incompatible*: Remove implicit field creation, i.e. using th... |
marshmallow-code__marshmallow-2715 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"examples/peewee_example.py:UserSchema",
"examples/peewee_example.py:TodoSchema"
]
},
"file": "examples/peewee_example.py"
},
{
"changes": {
... | marshmallow-code/marshmallow | a33a5f7a6c7ac961d216dbd27aa78f30e171ba54 | Rename pass_many to pass_collection
Follow-up to discussion in https://github.com/marshmallow-code/marshmallow/issues/1368 : `pass_many` is a misleading name and should be improved. | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 4997b9cf..bd814803 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -23,6 +23,7 @@ As a consequence of this change:
- *Backwards-incompatible*: Custom validators must raise a `ValidationError <marshmallow.exceptions.ValidationError>` for invalid values.
Returning `F... |
marshmallow-code__marshmallow-2800 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow/validate.py:URL.__call__"
],
"edited_modules": [
"src/marshmallow/validate.py:URL"
]
},
"file": "src/marshmallow/validate.py"
}
] | marshmallow-code/marshmallow | ea26aeb08c37c4e4c5bd323689c873d14f13d58d | `fields.Url` does not accept `file` URLs without host
# Steps to reproduce
Run this test case:
```
import marshmallow as mm
class LOL(mm.Schema):
url = mm.fields.Url(schemes={'file'})
LOL().load(dict(url="file:///var/storage/somefile.zip"))
```
# Expected result
```
{'url': 'file:///var/storage/some... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index dc645c3c..a43a00f0 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -176,3 +176,4 @@ Contributors (chronological)
- Peter C `@somethingnew2-0 <https://github.com/somethingnew2-0>`_
- Marcel Jackwerth `@mrcljx` <https://github.com/mrcljx>`_
- Fares Abubaker `@Fares-Abubaker <... |
marshmallow-code__marshmallow-293 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/marshalling.py:Unmarshaller.deserialize"
],
"edited_modules": [
"marshmallow/marshalling.py:Unmarshaller"
]
},
"file": "marshmallow/marshalling.py"
},
{... | marshmallow-code/marshmallow | 39bed8d628e2d08da5026df2df5ec6b9e9bbadf3 | "Partial" deserialization support
For implementing `PATCH` handlers on REST endpoints, it would be useful to have a concept of partial deserialization.
This would mean ignoring missing required fields and default values for missing fields.
I know this sounds a bit weird, but it matches a standard CRUD endpoint fa... | diff --git a/docs/quickstart.rst b/docs/quickstart.rst
index 4e7dcdb5..959e915a 100644
--- a/docs/quickstart.rst
+++ b/docs/quickstart.rst
@@ -303,6 +303,22 @@ Dictionaries or lists are also accepted as the custom error message, in case you
# 'age': ['Age is required.'],
# 'city': {'message': 'City required... |
marshmallow-code__marshmallow-299 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/marshalling.py:ErrorStore.call_and_store"
],
"edited_modules": [
"marshmallow/marshalling.py:ErrorStore"
]
},
"file": "marshmallow/marshalling.py"
}
] | marshmallow-code/marshmallow | 1dbcae9c439d1a268717feb089351fc3c5180ac3 | Field-level validation errors cannot be saved on a nested field with many=True
When validating a field, all of its error messages are saved and appended to the list of messages for that field name in `call_and_store`, but for `fields.Nested` with `many=True` the error messages for child elements of the collection are s... | diff --git a/marshmallow/marshalling.py b/marshmallow/marshalling.py
index 5caca583..7961f087 100644
--- a/marshmallow/marshalling.py
+++ b/marshmallow/marshalling.py
@@ -21,6 +21,8 @@ __all__ = [
'Unmarshaller',
]
+# Key used for field-level validation errors on nested fields
+FIELD = '_field'
class ErrorSt... |
marshmallow-code__marshmallow-691 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/fields.py:Number._validated",
"marshmallow/fields.py:FormattedString._serialize",
"marshmallow/fields.py:DateTime._serialize",
"marshmallow/fields.py:Time._deserializ... | marshmallow-code/marshmallow | 48e36fa35c8019c811b0281f7b358f11ddc55173 | fields.TimeDelta precision
Hi all,
I'm working on a project that uses marshmallow and we're using a subclass of TimeDelta with `hour` precision.
Would you be interested in a PR with support for other precisions?
| diff --git a/AUTHORS.rst b/AUTHORS.rst
index 002b8bea..594a6d4a 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -90,3 +90,4 @@ Contributors (chronological)
- Yoichi NAKAYAMA `@yoichi <https://github.com/yoichi>`_
- Bernhard M. Wiedemann `@bmwiedemann <https://github.com/bmwiedemann>`_
- Scott Werner `@scottwernervt <h... |
marshmallow-code__marshmallow-700 | [
{
"changes": {
"added_entities": [
"marshmallow/fields.py:Dict.__init__",
"marshmallow/fields.py:Dict._serialize"
],
"added_modules": null,
"edited_entities": [
"marshmallow/fields.py:Dict._deserialize"
],
"edited_modules": [
"marshmallow/field... | marshmallow-code/marshmallow | 12044877d8af3d8f07c39bf0c5df78d3d7a22df1 | How to create a Schema containing a dict of nested Schema?
Hi. I've been digging around and couldn't find the answer to this.
Say I've got a model like this:
``` python
class AlbumSchema(Schema):
year = fields.Int()
class ArtistSchema(Schema):
name = fields.Str()
albums = ...
```
I want `albums` to be a... | diff --git a/marshmallow/fields.py b/marshmallow/fields.py
index d2ea022f..5a0835da 100755
--- a/marshmallow/fields.py
+++ b/marshmallow/fields.py
@@ -1125,12 +1125,20 @@ class TimeDelta(Field):
class Dict(Field):
- """A dict field. Supports dicts and dict-like objects.
+ """A dict field. Supports dicts and ... |
marshmallow-code__marshmallow-744 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/schema.py:BaseSchema._invoke_validators"
],
"edited_modules": [
"marshmallow/schema.py:BaseSchema"
]
},
"file": "marshmallow/schema.py"
}
] | marshmallow-code/marshmallow | 642d18b58d9b42d16b450a30b42aa57ea3859192 | post_dump is passing a list of objects as original object
Hi,
I think post_dump with pass_original=True should pass the original object related to the data serialized and not a list of objects which this object belongs to.
``` python
from marshmallow import fields, post_dump, Schema
class DeviceSchema(Schema):
i... | diff --git a/marshmallow/schema.py b/marshmallow/schema.py
index 2327081a..79bb8ee1 100644
--- a/marshmallow/schema.py
+++ b/marshmallow/schema.py
@@ -836,11 +836,11 @@ class BaseSchema(base.SchemaABC):
if pass_many:
validator = functools.partial(validator, many=many)
if many ... |
marshmallow-code__marshmallow-750 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/schema.py:BaseSchema._invoke_processors"
],
"edited_modules": [
"marshmallow/schema.py:BaseSchema"
]
},
"file": "marshmallow/schema.py"
}
] | marshmallow-code/marshmallow | a867533d53ddbe8cb0ff63c1dc3ca53337ba525c | post_dump is passing a list of objects as original object
Hi,
I think post_dump with pass_original=True should pass the original object related to the data serialized and not a list of objects which this object belongs to.
``` python
from marshmallow import fields, post_dump, Schema
class DeviceSchema(Schema):
i... | diff --git a/marshmallow/decorators.py b/marshmallow/decorators.py
index 8b6df0df..cd850fc0 100644
--- a/marshmallow/decorators.py
+++ b/marshmallow/decorators.py
@@ -107,6 +107,9 @@ def post_dump(fn=None, pass_many=False, pass_original=False):
By default, receives a single object at a time, transparently handling... |
marshmallow-code__marshmallow-756 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/fields.py:Field.serialize",
"marshmallow/fields.py:Field.deserialize"
],
"edited_modules": [
"marshmallow/fields.py:Field"
]
},
"file": "marshmallow... | marshmallow-code/marshmallow | 08fba280e37f19ae24a82a93ec6868b6704e2f64 | missing and default values should be specified in deserialized form
Marshmallow expects `missing` and `default` values to be specified in a pre-serialized form, which is inconvenient and unintuitive.
Here is a schema which I would expect to work:
``` python
import datetime
import uuid
class TestSchema(Schema):
i... | diff --git a/docs/quickstart.rst b/docs/quickstart.rst
index db101bd1..1ee80e53 100644
--- a/docs/quickstart.rst
+++ b/docs/quickstart.rst
@@ -481,6 +481,25 @@ In the context of a web API, the ``dump_only`` and ``load_only`` parameters are
created_at = fields.DateTime(dump_only=True)
+Specify default Seria... |
marshmallow-code__marshmallow-819 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/schema.py:BaseSchema._invoke_processors"
],
"edited_modules": [
"marshmallow/schema.py:BaseSchema"
]
},
"file": "marshmallow/schema.py"
},
{
"change... | marshmallow-code/marshmallow | 0f7fac3d034be94fa6d996cf58cd826879b15be8 | Unenveloping None values doesn't work as expected
Trying to unenvelope serialized data when the contained data is None continues deserialization with the original data. This makes it impossible to deserialize nested fields with enveloped data where None is a valid value. (Related: http://jsonapi.org/format/)
Example (... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 50d5f9d4..d6aedd4a 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,19 +6,25 @@ Changelog
Features:
-* Clean up code for schema hooks (:issue:`814`). Thanks :user:`taion`.
-* Minor performance improvement from simplifying ``utils.get_value`` (:issue:`811`). Than... |
marshmallow-code__marshmallow-821 | [
{
"changes": {
"added_entities": [
"marshmallow/fields.py:Dict._add_to_schema"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"marshmallow/fields.py:Dict"
]
},
"file": "marshmallow/fields.py"
}
] | marshmallow-code/marshmallow | bfc6bedf291bb54f8623acc9380139c06bc8acb2 | Question: How can I pass the context in a nested field of a structured dict?
I noticed that if you use a nested field for values in a structured Dict, the context is not automatically given to the nested schema. Is there a way to pass it the context?
Example:
```python
class Inner(Schema):
foo = fields.String... | diff --git a/marshmallow/fields.py b/marshmallow/fields.py
index ecfd28d4..737fbfb0 100755
--- a/marshmallow/fields.py
+++ b/marshmallow/fields.py
@@ -1134,6 +1134,15 @@ class Dict(Field):
'marshmallow.base.FieldABC')
self.key_container = keys
+ def _add_to_schema(sel... |
marshmallow-code__marshmallow-823 | [
{
"changes": {
"added_entities": [
"marshmallow/fields.py:Nested._test_collection",
"marshmallow/fields.py:Nested._load",
"marshmallow/fields.py:Pluck.__init__",
"marshmallow/fields.py:Pluck._serialize",
"marshmallow/fields.py:Pluck._deserialize"
],
"add... | marshmallow-code/marshmallow | 7e19a295e7e23c0ef6dfa730dbf21e67f9408310 | Nested single string 'only' behavior edge case
When using Nested fields, passing a single string field to `only` does not work as expected when applying a transform with `on_bind_field`
```python
from marshmallow import fields, Schema
def test_nested_only_on_bind_field():
def to_camel_case(snake_str):... | diff --git a/docs/nesting.rst b/docs/nesting.rst
index b5afbaf1..06f2f309 100644
--- a/docs/nesting.rst
+++ b/docs/nesting.rst
@@ -99,32 +99,30 @@ You can represent the attributes of deeply nested objects using dot delimiters.
# }
# }
-.. note::
+You can replace nested data with a single value (or flat ... |
marshmallow-code__marshmallow-826 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/schema.py:BaseSchema._update_fields"
],
"edited_modules": [
"marshmallow/schema.py:BaseSchema"
]
},
"file": "marshmallow/schema.py"
}
] | marshmallow-code/marshmallow | cda2b4c97ac28412580567ba98e82568de125513 | only is not bound by declared and additional fields on serializaton
The only parameter is correctly bound to the fields that are defined in Meta.fields (#183):
```python
class MySchema(Schema):
class Meta:
fields = ('a', )
MySchema(only=('b', )).dump({'a': 1, 'b': 2}).data == {}
```
Strangely i... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index e09e780c..3d135fbf 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -102,4 +102,5 @@ Contributors (chronological)
- Suren Khorenyan `@surik00 <https://github.com/surik00>`_
- Jeffrey Berger `@JeffBerger <https://github.com/JeffBerger>`_
- Felix Yan `@felixonmars <https://git... |
marshmallow-code__marshmallow-872 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/marshalling.py:Unmarshaller.deserialize"
],
"edited_modules": [
"marshmallow/marshalling.py:Unmarshaller"
]
},
"file": "marshmallow/marshalling.py"
},
{... | marshmallow-code/marshmallow | 510a45ede0be3d42f3ed6b3626b116d2c6216473 | Change default for `unknown` to `RAISE`
As a follow up to https://github.com/marshmallow-code/marshmallow/issues/524#issuecomment-397165731 and #838 : the default for `unknown` should be changed to `RAISE`.
| diff --git a/marshmallow/marshalling.py b/marshmallow/marshalling.py
index a3dff0bb..88e4d3b6 100644
--- a/marshmallow/marshalling.py
+++ b/marshmallow/marshalling.py
@@ -204,7 +204,7 @@ class Unmarshaller(ErrorStore):
def deserialize(
self, data, fields_dict, many=False, partial=False,
- unknown... |
marshmallow-code__marshmallow-945 | [
{
"changes": {
"added_entities": [
"marshmallow/fields.py:Float.__init__",
"marshmallow/fields.py:Float._format_num"
],
"added_modules": null,
"edited_entities": [
"marshmallow/fields.py:Number._format_num",
"marshmallow/fields.py:Number._validated",
... | marshmallow-code/marshmallow | cdcede15926f90448c2b532c78f1d158ae22eed5 | RFC: extend allow_nan parameter to all number fields
`Decimal` field has an `allow_nan` parameter (`False` by default):
> If `True`, `NaN`, `Infinity` and `-Infinity` are allowed, even though they are illegal according to the JSON specification.
Any objection to extend it to all numbers?
Currently, `Int` will ... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index bfe5bf52..d531cad7 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,12 +6,17 @@ Changelog
Features:
-- Add ``fields.Pluck`` for serializing a single field from a nested object (:issue:`800`). Thanks :user:`timc13` for the
- feedback and :user:`deckar01` for the... |
marshmallow-code__marshmallow-950 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/schema.py:BaseSchema.__filter_fields"
],
"edited_modules": [
"marshmallow/schema.py:BaseSchema"
]
},
"file": "marshmallow/schema.py"
}
] | marshmallow-code/marshmallow | b0ebaf6f13f9833ccc6b19900208b211597480e9 | No attribute '_add_to_schema' when dumping Schema and Nested Field is None
Hi Marshmallow Code!
I have recently discovered and began implementing your code for my own projects and I must say you have changed how I work with databases forever!
I have been running up against a wall with this issue however, and dec... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index aff06634..d30adf1c 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
Changelog
---------
+2.15.5
++++++++++++++++++++
+
+Bug fixes:
+
+- Handle empty SQAlchemy lazy lists gracefully when dumping (:issue:`948`).
+ Thanks :user:`vke-code` for the catch a... |
marshmallow-code__marshmallow-959 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/marshalling.py:Unmarshaller.deserialize"
],
"edited_modules": [
"marshmallow/marshalling.py:Unmarshaller"
]
},
"file": "marshmallow/marshalling.py"
}
] | marshmallow-code/marshmallow | 43e07d734ca37bc1a9b473515dd448157504cfae | TypeError thrown with many=True on non-iterable types
With `3.0.0b13` this passes:
```python
class Sch(Schema):
foo = fields.Str()
for p in [False, 1, 1.2]:
with pytest.raises(TypeError):
Sch(many=True).load(p)
```
I think `Schema.load()` should rather catch invalid types and raise `Valida... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index a65b93a5..2a1b44f9 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,15 @@
Changelog
---------
+2.15.6 (unreleased)
++++++++++++++++++++
+
+Bug fixes:
+
+- Prevent ``TypeError`` when a non-collection is passed to a ``Schema`` with ``many=True``.
+ Instead, r... |
marshmallow-code__marshmallow-960 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/fields.py:List._add_to_schema",
"marshmallow/fields.py:Dict._add_to_schema"
],
"edited_modules": [
"marshmallow/fields.py:List",
"marshmallow/fields.py:Di... | marshmallow-code/marshmallow | d9725e0e127d9ef214ff1f3024cc150440ae1b67 | Root reference is broken for nested/container fields when using schema inheritance
I use schema inheritance a lot to reuse shared parts of schemas. Additionally I have some custom fields with validation methods which use references to the field's root schema. When these custom fields are used in nested schemas or insi... | diff --git a/marshmallow/fields.py b/marshmallow/fields.py
index b0580fd3..ea9b3efb 100755
--- a/marshmallow/fields.py
+++ b/marshmallow/fields.py
@@ -4,6 +4,7 @@
from __future__ import absolute_import, unicode_literals
import collections
+import copy
import datetime as dt
import numbers
import uuid
@@ -568,6 +5... |
marshmallow-code__marshmallow-968 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"marshmallow/utils.py:from_iso_datetime",
"marshmallow/utils.py:from_iso_time",
"marshmallow/utils.py:from_iso_date"
],
"edited_modules": [
"marshmallow/utils.py:from_... | marshmallow-code/marshmallow | 54e1605604aaf647ee4b03340284b348341eff62 | fields.Date accepts input in non ISO8601 format. This leads to unaccepted behaviour.
The doc of `fields.Date` suggests that it accepts only ISO8601 date format.
```python
class Date(Field):
"""ISO8601-formatted date string.
:param kwargs: The same keyword arguments that :class:`Field` receives.
"""
... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index 03dc84b3..5c44518e 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -107,3 +107,4 @@ Contributors (chronological)
- Maxim Novikov `@m-novikov <https://github.com/m-novikov>`_
- James Remeika `@remeika <https://github.com/remeika>`_
- Karandeep Singh Nagra `@knagra <https://g... |
marshmallow-code__marshmallow-jsonapi-289 | [
{
"changes": {
"added_entities": [
"marshmallow_jsonapi/schema.py:Schema._get_formatted_errors",
"marshmallow_jsonapi/schema.py:Schema._process_nested_errors"
],
"added_modules": null,
"edited_entities": [
"marshmallow_jsonapi/schema.py:Schema.format_errors"
... | marshmallow-code/marshmallow-jsonapi | f0f3ed18180c40420ea484b931d6f9545857a80a | Validation errors for nested fields are not formatted properly
```
from marshmallow import validate, Schema as BasicSchema
from marshmallow_jsonapi import Schema, fields
class SecondNestedSchema(BasicSchema):
second = fields.String(validate=validate.OneOf(['test']))
class FirstNestedSchema(BasicSchema)... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index 05a075a..5813f7c 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -31,3 +31,4 @@ Contributors (chronological)
- `@aberres <https://github.com/aberres>`_
- George Alton `@georgealton <https://github.com/georgealton>`_
- Areeb Jamal `@iamareebjamal <https://github.com/iamareeb... |
marshmallow-code__marshmallow-sqlalchemy-242 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow_sqlalchemy/fields.py:Related._get_existing_instance"
],
"edited_modules": [
"src/marshmallow_sqlalchemy/fields.py:Related"
]
},
"file": "src/marshmallow... | marshmallow-code/marshmallow-sqlalchemy | f766686dff24146e43474edc4c8a947ace8868aa | Error `TypeError: unhashable type: 'list'`
If to try to deserialize model which should have relationship one to many and put the array in this field then there will be an error `TypeError: unhashable type: 'list'` instead of ValidationError
Example
class M(Base):
....
store_id = Column(ForeignKe... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 9f9ec19..904263a 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
Changelog
---------
+0.17.2 (unreleased)
++++++++++++++++++++
+
+Bug fixes:
+
+* Fix error handling when passing an invalid type to ``Related`` (:issue:`223`).
+ Thanks :user:`heckad` f... |
marshmallow-code__marshmallow-sqlalchemy-280 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow_sqlalchemy/convert.py:ModelConverter.fields_for_model",
"src/marshmallow_sqlalchemy/convert.py:ModelConverter.property2field"
],
"edited_modules": [
"src/mars... | marshmallow-code/marshmallow-sqlalchemy | 00f08781a06b62f29e412d08432ac0e55e806939 | Synonyms on Models
I have a model which makes use of a [synonym](https://docs.sqlalchemy.org/en/latest/orm/mapped_attributes.html#synonyms) for convenience. Flask.Marshmallow raises an `AttributeError` exception when a ModelSchema that uses this class is defined.
```
class Department(Model):
"""Represents a de... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 626bc52..e4d8793 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,15 @@
Changelog
---------
+0.22.2 (unreleased)
++++++++++++++++++++
+
+Bug fixes:
+
+* Avoid error when using ``SQLAlchemyModelSchema``, ``ModelSchema``, or ``fields_for_model``
+ with a mode... |
marshmallow-code__marshmallow-sqlalchemy-307 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "setup.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow_sqlalchemy/... | marshmallow-code/marshmallow-sqlalchemy | 3d02bbb15d43e2e4c65039694faa8a73278c4006 | Ordering output doesn't work for auto_field
In marshmallow, to order serialization output, set ordered = True in the Meta class as follows.
```python
class MyModelSchema(SQLAlchemyAutoSchema):
class Meta:
model = MyModel
ordered = True
some_field = auto_field(validate=validate.Range(mi... | diff --git a/AUTHORS.rst b/AUTHORS.rst
index 1f8c8be..252f378 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -35,4 +35,4 @@ Contributors
- Pierre Verkest `@petrus-v <https://github.com/petrus-v>`_
- Erik Cederstrand `@ecederstrand <https://github.com/ecederstrand>`_
- Daven Quinn `@davenquinn <https://github.com/dave... |
marshmallow-code__marshmallow-sqlalchemy-640 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow_sqlalchemy/convert.py:ModelConverter._add_column_kwargs"
],
"edited_modules": [
"src/marshmallow_sqlalchemy/convert.py:ModelConverter"
]
},
"file": "src... | marshmallow-code/marshmallow-sqlalchemy | 11971438fe15f1110136c59df68a8be30fb1d526 | marhsmallow auto generated field using `enum.Enum` raises error on load
Hi,
When I define SQLAlchemy columns using `enum.Enum` the auto generated marshmallow field fails validation when I try to load:
```python
import enum
import marshmallow as ma
import sqlalchemy as sa
from marshmallow_sqlalchemy import SQL... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 7f0037b..e0089e9 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -8,6 +8,11 @@ Features:
* Typing: Add type annotations to `fields <marshmallow_sqlalchemy.fields>`.
+Bug fixes:
+
+* Fix auto-generation of `marshmallow.fields.Enum` field from `sqlalchemy.Enum` colu... |
marshmallow-code__marshmallow-sqlalchemy-645 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/marshmallow_sqlalchemy/convert.py:ModelConverter._add_relationship_kwargs"
],
"edited_modules": [
"src/marshmallow_sqlalchemy/convert.py:ModelConverter"
]
},
"file"... | marshmallow-code/marshmallow-sqlalchemy | 52741e6aa9ca0883499a56e7da482606f6feebe7 | field_for() converter for Relationships not detecting nullable=False
Hi, I had a case where I had the following (this is example code):
```python
class Book:
...
author_id = Column(Integer, ForeignKey('author.id'), nullable=False)
author = relationship('Author', lazy='selectin')
```
And when I tried ... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index cfa4a91..fd30788 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -15,6 +15,9 @@ Bug fixes:
* Fix behavior of ``include_fk = False`` in options when parent
schema sets ``include_fk = True`` (:issue:`440`).
Thanks :user:`uhnomoli` for reporting.
+* Fields generate... |
marshmallow-code__marshmallow-sqlalchemy-648 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"src/marshmallow_sqlalchemy/convert.py:ModelConverter"
]
},
"file": "src/marshmallow_sqlalchemy/convert.py"
}
] | marshmallow-code/marshmallow-sqlalchemy | ac438d6d175ac378e8f3c0d1a78aec99e5077ff4 | [Bug] SQL Alchemy pickle not dumping properly
I have a SQLA model:
``` python
class Model(db.Model):
__tablename__ = "table"
id = Column(Integer, primary_key=True
data = Column(PickleType, nullable=False)
```
Then auto create a Marshmallow Schema:
``` python
class VerificationSchema(ma.SQLAlchemyAu... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index fcf01b4..1aee458 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,11 @@ Changelog
1.4.0 (unreleased)
++++++++++++++++++
+Bug fixes:
+
+* Fix handling of `sqlalchemy.PickleType` columns (:issue:`394`)
+ Thanks :user:`Eyon42` for reporting.
+
Other changes:
... |
marshmallow-code__webargs-428 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/aiohttpparser.py:AIOHTTPParser.parse_json",
"src/webargs/aiohttpparser.py:AIOHTTPParser.handle_invalid_json_error"
],
"edited_modules": [
"src/webargs/aiohttppars... | marshmallow-code/webargs | f2db6bcb2b2f963b819d409da4788411fea3170d | Non UTF-8 json payload produce a 500 and a stack trace
Hi,
First of all thanks for thie library, while doing some testing with random payload we stumbled upon a corner case:
## Actual Behavior:
If non utf-8 data is sent with header Application/Json the `core`'s `parse_json` will raise a UnicodeDecodeError, which... | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 1b98a37..3eb6b9c 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -15,7 +15,7 @@ repos:
- id: blacken-docs
additional_dependencies: [black==19.3b0]
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v0.720
+ rev:... |
marshmallow-code__webargs-462 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/aiohttpparser.py:AIOHTTPParser.load_form",
"src/webargs/aiohttpparser.py:AIOHTTPParser.load_json"
],
"edited_modules": [
"src/webargs/aiohttpparser.py:AIOHTTPPars... | marshmallow-code/webargs | 1b34470908cb54862b7aeb578f794ac3285cdf38 | Re-factor cache invalidation
https://github.com/marshmallow-code/webargs/issues/371#issuecomment-471578852 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index ceb534d..71e4ce4 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
Changelog
---------
+6.0.0b6 (Unreleased)
+********************
+
+Refactoring:
+
+* Remove the cache attached to webargs parsers. Due to changes between webargs
+ v5 and v6, the cache ... |
marshmallow-code__webargs-463 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/asyncparser.py:AsyncParser.parse",
"src/webargs/asyncparser.py:AsyncParser._on_validation_error"
],
"edited_modules": [
"src/webargs/asyncparser.py:AsyncParser"
... | marshmallow-code/webargs | 20b55591888b3cfaae061d858a6f21cb17edee44 | [RFC] Namespace error structures by location in response
I think there's a case we never really considered: two schemas in a different location with a common field name.
In webargs 5, this is not possible in a single `use_args` call. In a multi `use_args` call, it depends if the user specifies the locations. The res... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index c11fe33..6991c91 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,16 @@
Changelog
---------
+6.0.0b7 (Unreleased)
+********************
+
+Features:
+
+* *Backwards-incompatible*: webargs will rewrite the error messages in
+ ValidationErrors to be namespace... |
marshmallow-code__webargs-464 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/fields.py:DelimitedList.__init__",
"src/webargs/fields.py:DelimitedList._serialize",
"src/webargs/fields.py:DelimitedList._deserialize"
],
"edited_modules": [
... | marshmallow-code/webargs | 01ef08a35a1ec9249725e54dc215efc682debfcf | RFC: Only accept delimited string in DelimitedList
`DelimitedList` accepts either a list or a delimited string (e.g. "foo,bar,baz").
I'd like to make it more strict by only accepting a delimited list. Rather than adding a `strict` parameter, I'm thinking of dropping the whole "also accept a list" feature.
Any rea... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8c56899..a88f6bc 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,16 @@
Changelog
---------
+6.0.0b5 (Unreleased)
+********************
+
+Refactoring:
+
+* *Backwards-incompatible*: `DelimitedList` now requires that its input be a
+ string and always seria... |
marshmallow-code__webargs-509 | [
{
"changes": {
"added_entities": [
"src/webargs/fields.py:DelimitedTuple.__init__"
],
"added_modules": [
"src/webargs/fields.py:DelimitedFieldMixin",
"src/webargs/fields.py:DelimitedTuple"
],
"edited_entities": [
"src/webargs/fields.py:DelimitedList.... | marshmallow-code/webargs | 2c85a334ea59095f17a0c7fb6e6617adbf356e84 | 'Not a valid tuple.' when trying to use marshmallow fields.Tuple for argument validation
I'm trying to use the marshmallow fields.Tuple for querystring argument validation on a GET request using Flask. The issue I'm running into is that no matter what type of object I declare and no matter what I use in the request, ... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 1e1bfda..d5e3c65 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,17 @@
Changelog
---------
+6.1.0 (Unreleased)
+******************
+
+Features:
+
+* Add ``fields.DelimitedTuple`` when using marshmallow 3. This behaves as a
+ combination of ``fields.Delimit... |
marshmallow-code__webargs-537 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/multidictproxy.py:MultiDictProxy.__iter__"
],
"edited_modules": [
"src/webargs/multidictproxy.py:MultiDictProxy"
]
},
"file": "src/webargs/multidictproxy.py... | marshmallow-code/webargs | c8c9cc15e390641fb48f94054157addf22629858 | Errors while validating arguments in headers result in a flask crash
If you make a view with header arguments `@bp.arguments(someschema, location='headers')`
Then feed it headers that are not defined in the schema, it will (rightfully) cause a schema validation error, however the error created includes the entire head... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index f72d2b0..5c03e4d 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,16 @@
Changelog
---------
+6.1.1 (Unreleased)
+******************
+
+Bug fixes:
+
+* Failure to validate flask headers would produce error data which contained
+ tuples as keys, and was there... |
marshmallow-code__webargs-541 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/core.py:Parser.parse"
],
"edited_modules": [
"src/webargs/core.py:Parser"
]
},
"file": "src/webargs/core.py"
}
] | marshmallow-code/webargs | e62f478ae39efa55f363b389f5c69b583bf420f8 | Failing to (re)raise an error when handling validation errors should raise a new error
Per #525 , we're going to start warning if you setup an error handler which does not, itself, raise an error. The result of failing to raise in your handler is that parsing "falls through" and returns incorrect data (`None` today, bu... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 0b1acda..aef96c7 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -45,6 +45,12 @@ Usages are varied, but include
parser = MyParser()
+Changes:
+
+* Registered `error_handler` callbacks are required to raise an exception.
+ If a handler is invoked and no except... |
marshmallow-code__webargs-555 | [
{
"changes": {
"added_entities": [
"src/webargs/falconparser.py:FalconParser.load_media"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"src/webargs/falconparser.py:FalconParser"
]
},
"file": "src/webargs/falconparser.py"
}
] | marshmallow-code/webargs | 60a4a27143b4844294eb80fa3e8e29653d8f5a5f | FalconParser should ideally support falcon's native media decoding
Falcon has a native media handling mechanism which can decode an incoming request body based on the `Content-Type` header and adding the dictionary of resulting key-value pairs as a cached property `req.media`. I've written my own FalconParser subclass ... | diff --git a/src/webargs/falconparser.py b/src/webargs/falconparser.py
index 5b4a21f..d2eb448 100644
--- a/src/webargs/falconparser.py
+++ b/src/webargs/falconparser.py
@@ -3,6 +3,8 @@
import falcon
from falcon.util.uri import parse_query_string
+import marshmallow as ma
+
from webargs import core
from webargs.mu... |
marshmallow-code__webargs-583 | [
{
"changes": {
"added_entities": [
"src/webargs/core.py:Parser.pre_load"
],
"added_modules": null,
"edited_entities": [
"src/webargs/core.py:Parser.parse"
],
"edited_modules": [
"src/webargs/core.py:Parser"
]
},
"file": "src/webargs/core.... | marshmallow-code/webargs | f953dff5c77b5eeb96046aef4a29fd9d097085c3 | Automatically trim leading/trailing whitespace from argument values
Does webargs provide any clean way to do this? I guess leading/trailing whitespace are almost never something you want (especially when having required fields that must not be empty)... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 138d5f1..26589ca 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,6 +6,10 @@ Changelog
Features:
+* Add `Parser.pre_load` as a method for allowing users to modify data before
+ schema loading, but without redefining location loaders. See advanced docs on
+ `Pa... |
marshmallow-code__webargs-584 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/core.py:is_multiple"
],
"edited_modules": [
"src/webargs/core.py:is_multiple"
]
},
"file": "src/webargs/core.py"
},
{
"changes": {
"added_enti... | marshmallow-code/webargs | d4fbbb7e70648af961ba0c5214812bc8cf3426f1 | `is_multiple` vs custom fields
Right now I don't get multiple values in a custom field that does not inherit from the `List` field because `is_multiple` only checks for this.
And for some cases rewriting the field to be nested in an actual List field is not feasible, for example a `SQLAlchemyModelList`-like field wh... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 4549beb..732f7c0 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,19 @@
Changelog
---------
+7.1.0 (Unreleased)
+******************
+
+Features:
+
+* Detection of fields as "multi-value" for unpacking lists from multi-dict
+ types is now extensible with the... |
marshmallow-code__webargs-594 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"src/webargs/core.py:Parser"
]
},
"file": "src/webargs/core.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edi... | marshmallow-code/webargs | 2f05e314163825b57018ac9682d7e6463dbfcd35 | Add marshmallow.fields.Tuple to detected `is_multiple` fields
I noticed this while working on #584 . Currently, `is_multiple(ma.fields.List(...)) == True`, but `is_multiple(ma.fields.Tuple(...)) == False`.
We should add `Tuple` so that `is_multiple` returns true.
It is possible that users have subclassed `fields.Tu... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 703bfe6..f03f463 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,20 +1,20 @@
Changelog
---------
-7.1.0 (Unreleased)
+8.0.0 (Unreleased)
******************
Features:
* Detection of fields as "multi-value" for unpacking lists from multi-dict
- types is no... |
marshmallow-code__webargs-682 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/asyncparser.py:AsyncParser.use_args"
],
"edited_modules": [
"src/webargs/asyncparser.py:AsyncParser"
]
},
"file": "src/webargs/asyncparser.py"
},
{
... | marshmallow-code/webargs | ef8a34ae75ef200d7006ada35770aa170dae5902 | The type of "argmap" allows for `Mapping[str, Field]`, but `Schema.from_dict` only supports `Dict[str, Field]`
I ran into this while looking at getting #663 merged.
We have arguments annotated as allowing a `Mapping`. The most likely usage for users is just a dict, and that is all that our examples show.
`Schema.fr... | diff --git a/src/webargs/asyncparser.py b/src/webargs/asyncparser.py
index b0b1024..2335097 100644
--- a/src/webargs/asyncparser.py
+++ b/src/webargs/asyncparser.py
@@ -5,7 +5,6 @@ import asyncio
import functools
import inspect
import typing
-from collections.abc import Mapping
from marshmallow import Schema, Val... |
marshmallow-code__webargs-832 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/webargs/fields.py:DelimitedFieldMixin._deserialize",
"src/webargs/fields.py:DelimitedTuple.__init__"
],
"edited_modules": [
"src/webargs/fields.py:DelimitedFieldMixin",
... | marshmallow-code/webargs | 44e2037a5607f3655f47d475272eab01d49aaaa0 | Dealing with empty values in `DelimitedFieldMixin`
`DelimitedList(String())` deserializes "a,,c" as `["a", "", "c"]`.
I guess this meets user expectations.
My expectation with integers would be that
`DelimitedList(Integer(allow_none=True))` deserializes `"1,,3"` as `[1,None,3]`
but it errors.
The reason ... | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index d02eb12..3ba8020 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,9 +1,34 @@
Changelog
---------
-8.3.1 (Unreleased)
+8.4.0 (Unreleased)
******************
+Features:
+
+* Add a new class attribute, ``empty_value`` to ``DelimitedList`` and
+ ``DelimitedTuple`... |
martin-majlis__Wikipedia-API-249 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "example.py"
},
{
"changes": {
"added_entities": [
"wikipediaapi/__init__.py:Wikipedia._construct_params",
"wikipediaapi/__init__... | martin-majlis/Wikipedia-API | 7c8e1fbdb475b3c6d5cde51801bbcd6533553d0d | Allow specifying language variant
Some wikipedia pages (such as Serbian and Chinese) have multiple language variants that are equivalent.
Fetching the content is then dependent on the variant variable in the API: https://zh.wikipedia.org/wiki/Special:API%E6%B2%99%E7%9B%92?uselang=en#action=parse&format=json&variant=... | diff --git a/API.rst b/API.rst
index 7055c5c..8212beb 100644
--- a/API.rst
+++ b/API.rst
@@ -3,7 +3,7 @@ API
Wikipedia
---------
-* ``__init__(user_agent: str, language='en', extract_format=ExtractFormat.WIKI, headers: Optional[Dict[str, Any]] = None, **kwargs)``
+* ``__init__(user_agent: str, language='en', varian... |
martinblech__xmltodict-81 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"xmltodict.py:unparse"
],
"edited_modules": [
"xmltodict.py:unparse"
]
},
"file": "xmltodict.py"
}
] | martinblech/xmltodict | a3a95592b875cc3d2472a431a197c9c1a5d8a788 | Parameter to Disable Multiple Root Check
I'm trying to convert a dict to an xml snippet, but this xml snippet is just supposed to be part of a later full document, so it may or may not have one root element. Unfortunately a ValueError is thrown if there is more than one possible root element - it would be great if ther... | diff --git a/xmltodict.py b/xmltodict.py
index 4fdbb16..b0ba601 100755
--- a/xmltodict.py
+++ b/xmltodict.py
@@ -318,7 +318,8 @@ def unparse(input_dict, output=None, encoding='utf-8', full_document=True,
can be customized with the `newl` and `indent` parameters.
"""
- ((key, value),) = input_dict.items()... |
martinfleis__clustergram-11 | [
{
"changes": {
"added_entities": [
"clustergram/clustergram.py:Clustergram._scipy_hierarchical"
],
"added_modules": null,
"edited_entities": [
"clustergram/clustergram.py:Clustergram.__init__",
"clustergram/clustergram.py:Clustergram.fit",
"clustergram/clu... | martinfleis/clustergram | 5bf2cdcbd53b35cac8d43bbe6d15c4157311a0b0 | Support hierarchical clustering
Supporting hierarchical clustering as in the original Schonlau's paper would be nice. Not sure if using scipy or sklearn, will have to explore. | diff --git a/README.md b/README.md
index 2e70303..de31fbe 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Clustergram is a diagram proposed by Matthias Schonlau in his paper *[The cluste
The clustergram was later implemented in R by [Tal Galili](https://www.r-statistics.com/2010/06/clustergram-visualization... |
martinfleis__clustergram-12 | [
{
"changes": {
"added_entities": [
"clustergram/clustergram.py:Clustergram.from_centers",
"clustergram/clustergram.py:Clustergram.from_data"
],
"added_modules": null,
"edited_entities": [
"clustergram/clustergram.py:Clustergram.__init__"
],
"edited_mod... | martinfleis/clustergram | 35bbf8d8c18d98950a1a93d06e6efcaf84c34e2f | Allow manual input
Allow manual input of cluster centers, data and labels to generate clustergram based on unsupported clusterings, like from spopt. | diff --git a/README.md b/README.md
index de31fbe..c80f99d 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Clustergram is a diagram proposed by Matthias Schonlau in his paper *[The cluste
The clustergram was later implemented in R by [Tal Galili](https://www.r-statistics.com/2010/06/clustergram-visualization... |
martinfleis__clustergram-8 | [
{
"changes": {
"added_entities": [
"clustergram/clustergram.py:Clustergram.silhouette_score",
"clustergram/clustergram.py:Clustergram.calinski_harabasz_score",
"clustergram/clustergram.py:Clustergram.davies_bouldin_score",
"clustergram/clustergram.py:Clustergram._compute_pc... | martinfleis/clustergram | 9085ebd8e6ce886a79c4bde706de73d3b7f15db6 | Optionally measure silhouette and other metrics
Add an option to measure additional metrics to assess the results of clustering, like a silhouette score or Calinski-Harabasz. | diff --git a/README.md b/README.md
index 37fa78e..2e70303 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Clustergram is a diagram proposed by Matthias Schonlau in his paper *[The cluste
The clustergram was later implemented in R by [Tal Galili](https://www.r-statistics.com/2010/06/clustergram-visualization... |
matchms__matchms-212 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"matchms/similarity/spectrum_similarity_functions.py:collect_peak_pairs",
"matchms/similarity/spectrum_similarity_functions.py:find_matches"
],
"edited_modules": [
"matchms/si... | matchms/matchms | 5cf15bcc89128f1bffacd62a8688062edfd8d06e | find_matches function expects 2d array with m/z and intensity, but uses only m/z
**Describe the bug**
The function is being given/passed information which is not necessary and used.
See https://github.com/matchms/matchms/blob/5cf15bcc89128f1bffacd62a8688062edfd8d06e/matchms/similarity/spectrum_similarity_functions.py... | diff --git a/matchms/similarity/spectrum_similarity_functions.py b/matchms/similarity/spectrum_similarity_functions.py
index 2cb4657b..381a424f 100644
--- a/matchms/similarity/spectrum_similarity_functions.py
+++ b/matchms/similarity/spectrum_similarity_functions.py
@@ -33,7 +33,7 @@ def collect_peak_pairs(spec1: numpy... |
matchms__matchms-223 | [
{
"changes": {
"added_entities": [
"matchms/filtering/add_precursor_mz.py:get_first_common_element"
],
"added_modules": [
"matchms/filtering/add_precursor_mz.py:get_first_common_element"
],
"edited_entities": [
"matchms/filtering/add_precursor_mz.py:add_prec... | matchms/matchms | 7d9a1620e78457e5a916d42abef7fc650b3e3109 | Add more possible field names to add precursor mz values from metadata
**Problem**
The code below currently only allows precursor m/z related data in `pepmass` or `precursor_mz` while fields such as `percursormz` etc. are ignored.
**Solution**
Expand the dictionary of allowed keys that can be used to store the pre... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 69fc630d..76c8e954 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- `add_precursor_mz()` filter now also checks for metadata in keys `precursormz` and `precur... |
matchms__matchms-349 | [
{
"changes": {
"added_entities": [
"matchms/networking/SimilarityNetwork.py:SimilarityNetwork.export_to_file",
"matchms/networking/SimilarityNetwork.py:SimilarityNetwork._generate_writer",
"matchms/networking/SimilarityNetwork.py:SimilarityNetwork._export_to_cyjs",
"matchms... | matchms/matchms | e780a91f9dfb7ba975f0e8e2732f800ee122163f | Add `.cyjs` export to networking module
**Is your feature request related to a problem? Please describe.**
Currently only `.graphml` output is supported, which is not supported by the cytoscape Galaxy plugin.
**Describe the solution you'd like**
Add the option to export to `.cyjs` using the networkx package to the... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index d41be843..d43aec48 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- `Spectrum` objects now also have `.mz` and `.intensities` properties [#339](https://github.com/m... |
matchms__matchms-350 | [
{
"changes": {
"added_entities": [
"matchms/networking/SimilarityNetwork.py:SimilarityNetwork.export_to_file",
"matchms/networking/SimilarityNetwork.py:SimilarityNetwork._generate_writer",
"matchms/networking/SimilarityNetwork.py:SimilarityNetwork._export_to_cyjs",
"matchms... | matchms/matchms | e780a91f9dfb7ba975f0e8e2732f800ee122163f | Add `.cyjs` export to networking module
**Is your feature request related to a problem? Please describe.**
Currently only `.graphml` output is supported, which is not supported by the cytoscape Galaxy plugin.
**Describe the solution you'd like**
Add the option to export to `.cyjs` using the networkx package to the... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index d41be843..d43aec48 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- `Spectrum` objects now also have `.mz` and `.intensities` properties [#339](https://github.com/m... |
matchms__matchms-408 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"matchms/exporting/save_as_mgf.py:save_as_mgf"
],
"edited_modules": [
"matchms/exporting/save_as_mgf.py:save_as_mgf"
]
},
"file": "matchms/exporting/save_as_mgf.py"
}
... | matchms/matchms | 6f499f6bcb74c748d7528c94c51b4de623bce266 | Rearrange tests in folders
Since there are plenty of tests, it might be better to rearrange them into folders regarding the different topics to make things a bit more organized. | diff --git a/README.rst b/README.rst
index ca66c274..42885b93 100644
--- a/README.rst
+++ b/README.rst
@@ -164,7 +164,7 @@ Introduction
To get started with matchms, we recommend following our `matchms introduction tutorial <https://blog.esciencecenter.nl/build-your-own-mass-spectrometry-analysis-pipeline-in-python-u... |
matchms__matchms-418 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"matchms/Metadata.py:Metadata.harmonize_values"
],
"edited_modules": [
"matchms/Metadata.py:Metadata"
]
},
"file": "matchms/Metadata.py"
}
] | matchms/matchms | 2af786d6f68365aee48546dff14fdcd502ca3750 | Empty `inchi` doesn't get removed but results in empty string -> remove invalid metadata after reading the spectrum
**Describe the bug**
Currently, an `inchi` entry that is empty will result in a metadata entry that holds an empty string.
Ideally, if spectra are loaded with `harmonize_metadata` as true, _invalid_ or ... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f7c6955..14901a6a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed pipeline filter [#414](https://github.com/matchms/matchms/pull/414)
- Removed fingerprint writing ... |
matchms__matchms-493 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"matchms/Pipeline.py:Pipeline.__init__",
"matchms/Pipeline.py:Pipeline._initialize_spectrum_processor_queries",
"matchms/Pipeline.py:Pipeline._initialize_spectrum_processor_references"
... | matchms/matchms | 6aa1fac88debee22495c8c02c64a3130b8b757f5 | Filter parameters in default pipelines are not used
When adding filter parameters in the default filters they are not used by SpectrumProcessor.
For instance in the code below "ion_mode_to_keep" is not set to "both"
```python
FULLY_ANNOTATED_PROCESSING = DEFAULT_FILTERS \
+ ["clean_adduct",
"derive... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 135242fa..09cb8c1c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,8 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased]
-## [0.22.0] - 2023-08-18
-
### Added
- New `SpectrumProcessing` class to be the centra... |
matchms__matchms-496 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"matchms/Pipeline.py:Pipeline.__init__",
"matchms/Pipeline.py:Pipeline._initialize_spectrum_processor_queries",
"matchms/Pipeline.py:Pipeline._initialize_spectrum_processor_references"
... | matchms/matchms | 6aa1fac88debee22495c8c02c64a3130b8b757f5 | Add default filters to yaml file
Any default settings of functions are not shown in the yaml file. This is bad for reproducibility, since changing any default settings in a filter function will currently result in a different pipeline running.
Suggested change:
Automatically get the default filter settings from ea... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 135242fa..09cb8c1c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,8 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased]
-## [0.22.0] - 2023-08-18
-
### Added
- New `SpectrumProcessing` class to be the centra... |
matchms__matchms-518 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"matchms/Fragments.py:Fragments.__eq__"
],
"edited_modules": [
"matchms/Fragments.py:Fragments"
]
},
"file": "matchms/Fragments.py"
},
{
"changes": {
"adde... | matchms/matchms | 72bf225ac846f85690f739129ed2210ee88fd4fe | Add peak changes to SpectrumProcessor
Currently we only keep track of changes in the metadata. But not of changes made to the peaks, this should be added to the processing report as well. | diff --git a/matchms/Fragments.py b/matchms/Fragments.py
index 41801dae..52787605 100644
--- a/matchms/Fragments.py
+++ b/matchms/Fragments.py
@@ -45,6 +45,8 @@ class Fragments:
assert self._is_sorted(), "mz values are out of order."
def __eq__(self, other):
+ if other is None:
+ retur... |
matchms__matchms-539 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"matchms/filtering/metadata_processing/interpret_pepmass.py:_get_mz_intensity_charge"
],
"edited_modules": [
"matchms/filtering/metadata_processing/interpret_pepmass.py:_get_mz_intens... | matchms/matchms | 4a75f129c1fa0a6ca1f7a72f5c9d39b92c3baf00 | Interpret pepmass doesn't handle strings
**Describe the bug**
Reading a spectrum with pepmass information fails upon metadata harmonization.
**To Reproduce**
Read the following spectrum:
```
PEPMASS: (981.54, None)
CHARGE: 1
MSLEVEL: 2
SOURCE_INSTRUMENT: LC-ESI-qTof
FILENAME: 130618_Ger_Jenia_WT-3-Des-MCLR... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8abb2a16..e51ca0b3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The file structure of metadata_utils was refactored [#503](https://github.com/matchms/matchms/pull/503)
- ... |
matchms__matchms-547 | [
{
"changes": {
"added_entities": [
"matchms/Metadata.py:Metadata.set_key_replacements"
],
"added_modules": null,
"edited_entities": [
"matchms/Metadata.py:Metadata.harmonize_keys"
],
"edited_modules": [
"matchms/Metadata.py:Metadata"
]
},
... | matchms/matchms | 765e45df4f1009241a9eef684aa653ead5982e53 | Enable setting key conversion with static method
Currently it is impossible to avoid the key conversion. It should be possible to set them to a user defined value with a static method.
| diff --git a/CHANGELOG.md b/CHANGELOG.md
index 804ca02d..d4218b17 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [unreleased]
+###... |
matchms__matchms-554 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"matchms/importing/load_from_msp.py:_parse_line_with_peaks",
"matchms/importing/load_from_msp.py:parse_metadata"
],
"edited_modules": [
"matchms/importing/load_from_msp.py:_pa... | matchms/matchms | c70418cc6f1aafbb71b9b2938bde71d4bf886de3 | Metadata processing of some msp files fails fatally
**Describe the bug**
When using some MoNA MassBank msp files, the metadata extraction fails on line 157 of load_from_msp.py.
**To Reproduce**
Attempt to load the MSP file here: https://mona.fiehnlab.ucdavis.edu/downloads, specifically the LC-MS/MS positive mode ... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5153e9d4..234bc96c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a save spectra function. To automatically save in the specified file format. [#543](https://github.co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.