Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump marshmallow from 3.12.2 to 3.16.0 #281

Merged
merged 1 commit into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions platform_neuro_flow_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ def storage(self) -> Storage:
@docs(tags=["bakes"], summary="List bakes in given project")
@query_schema(
project_id=fields.String(required=True),
name=fields.String(missing=None),
tags=fields.List(fields.String(), missing=tuple()),
since=fields.AwareDateTime(missing=None),
until=fields.AwareDateTime(missing=None),
reverse=fields.Boolean(missing=False),
fetch_last_attempt=fields.Boolean(missing=False),
name=fields.String(load_default=None),
tags=fields.List(fields.String(), load_default=tuple()),
since=fields.AwareDateTime(load_default=None),
until=fields.AwareDateTime(load_default=None),
reverse=fields.Boolean(load_default=False),
fetch_last_attempt=fields.Boolean(load_default=False),
)
@response_schema(BakeSchema(many=True), HTTPOk.status_code)
async def list(
Expand Down Expand Up @@ -571,7 +571,7 @@ async def create(

@docs(tags=["bakes"], summary="Get bake by id")
@query_schema(
fetch_last_attempt=fields.Boolean(missing=False),
fetch_last_attempt=fields.Boolean(load_default=False),
)
@response_schema(BakeSchema(), HTTPOk.status_code)
async def get(
Expand All @@ -593,7 +593,7 @@ async def get(
@query_schema(
project_id=fields.String(required=True),
name=fields.String(required=True),
fetch_last_attempt=fields.Boolean(missing=False),
fetch_last_attempt=fields.Boolean(load_default=False),
)
@response_schema(BakeSchema(), HTTPOk.status_code)
async def get_by_name(
Expand Down
18 changes: 10 additions & 8 deletions platform_neuro_flow_api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class LiveJobSchema(Schema):
project_id = fields.String(required=True)
multi = fields.Boolean(required=True)
tags = fields.List(fields.String(), required=True)
raw_id = fields.String(missing="")
raw_id = fields.String(load_default="")

@post_load
def make_live_job_data(self, data: Mapping[str, Any], **kwargs: Any) -> LiveJobData:
Expand Down Expand Up @@ -116,8 +116,10 @@ class BakeSchema(Schema):
id = fields.String(required=True, dump_only=True)
project_id = fields.String(required=True)
batch = fields.String(required=True)
created_at = fields.AwareDateTime(missing=lambda: datetime.now(timezone.utc))
meta = fields.Nested(BakeMetaSchema, required=False, missing=lambda: BakeMeta(None))
created_at = fields.AwareDateTime(load_default=lambda: datetime.now(timezone.utc))
meta = fields.Nested(
BakeMetaSchema, required=False, load_default=lambda: BakeMeta(None)
)
graphs = fields.Dict(
keys=FullIDField(),
values=fields.Dict(keys=FullIDField(), values=fields.List(FullIDField())),
Expand Down Expand Up @@ -174,7 +176,7 @@ class AttemptSchema(Schema):
bake_id = fields.String(required=True)
number = fields.Integer(required=True, strict=True)
created_at = fields.AwareDateTime(
missing=lambda: datetime.now(timezone.utc)
load_default=lambda: datetime.now(timezone.utc)
) # when
result = TaskStatusField(required=True)
configs_meta = fields.Nested(ConfigsMetaSchema(), required=True)
Expand All @@ -199,13 +201,13 @@ class TaskSchema(Schema):
raw_id = fields.String(required=True, allow_none=True) # empty string for no id
outputs = fields.Dict(
allow_none=True,
default=None,
dump_default=None,
keys=fields.String(required=True),
values=fields.String(required=True),
)
state = fields.Dict(
allow_none=True,
default=None,
dump_default=None,
keys=fields.String(required=True),
values=fields.String(required=True),
)
Expand All @@ -230,8 +232,8 @@ class CacheEntrySchema(Schema):
task_id = FullIDField(required=True)
batch = fields.String(required=True)
key = fields.String(required=True)
created_at = fields.AwareDateTime(missing=lambda: datetime.now(timezone.utc))
raw_id = fields.String(missing="")
created_at = fields.AwareDateTime(load_default=lambda: datetime.now(timezone.utc))
raw_id = fields.String(load_default="")
outputs = fields.Dict(values=fields.String(), required=True)
state = fields.Dict(values=fields.String(), required=True)

Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install_requires =
neuro-logging==21.12.2
neuro-sdk==22.1.3
aiohttp-cors==0.7.0
marshmallow==3.12.2
marshmallow==3.16.0
aiohttp-apispec==2.2.3
markupsafe==2.1.1
alembic==1.7.7
Expand All @@ -42,6 +42,7 @@ asyncio_mode = auto
filterwarnings=
error
ignore::DeprecationWarning:jose
ignore::marshmallow.warnings.RemovedInMarshmallow4Warning:apispec.ext.marshmallow.field_converter

[coverage:run]
branch = True
Expand Down