Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Bump flask-sqlalchemy from 3.0.3 to 3.1.1 (#146)
Browse files Browse the repository at this point in the history
* Bump flask-sqlalchemy from 3.0.3 to 3.1.1

Bumps [flask-sqlalchemy](https://github.com/pallets-eco/flask-sqlalchemy) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/pallets-eco/flask-sqlalchemy/releases)
- [Changelog](https://github.com/pallets-eco/flask-sqlalchemy/blob/main/CHANGES.rst)
- [Commits](pallets-eco/flask-sqlalchemy@3.0.3...3.1.1)

---
updated-dependencies:
- dependency-name: flask-sqlalchemy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* updating marshmallow imports for newer version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sarah Sloan <[email protected]>
Co-authored-by: srh-sloan <[email protected]>
  • Loading branch information
3 people authored Mar 20, 2024
1 parent e828d32 commit 2f3db2a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
3 changes: 0 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from config import Config
from db import db
from db import ma
from db import migrate


Expand All @@ -37,8 +36,6 @@ def create_app() -> Flask:
db.init_app(flask_app)
# Bind Flask-Migrate db utilities to Flask app
migrate.init_app(flask_app, db, directory="db/migrations", render_as_batch=True)
# Bind Marshmallow schema to Flask app
ma.init_app(flask_app)

# Add healthchecks to flask_app
health = Healthcheck(flask_app)
Expand Down
2 changes: 0 additions & 2 deletions db/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from flask_marshmallow import Marshmallow
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import MetaData
Expand All @@ -14,6 +13,5 @@
metadata = MetaData(naming_convention=convention)

db = SQLAlchemy(metadata=metadata)
ma = Marshmallow()

migrate = Migrate()
14 changes: 8 additions & 6 deletions db/schemas/account.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
from marshmallow import fields
from marshmallow.fields import Function
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
from marshmallow_sqlalchemy import auto_field

from db import ma
from db.models.account import Account


class AccountSchema(ma.SQLAlchemySchema):
class AccountSchema(SQLAlchemyAutoSchema):
class Meta:
model = Account

id = fields.UUID(data_key="account_id")
email = fields.String(data_key="email_address")
full_name = ma.auto_field()
azure_ad_subject_id = ma.auto_field()
roles = ma.Function(lambda obj: [role.role for role in obj.roles])
highest_role_map = ma.Function(lambda obj: obj.highest_role_map)
full_name = auto_field()
azure_ad_subject_id = auto_field()
roles = Function(lambda obj: [role.role for role in obj.roles])
highest_role_map = Function(lambda obj: obj.highest_role_map)
8 changes: 5 additions & 3 deletions db/schemas/role.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from db import ma
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
from marshmallow_sqlalchemy import auto_field

from db.models.role import Role


class RoleSchema(ma.SQLAlchemyAutoSchema):
class RoleSchema(SQLAlchemyAutoSchema):
class Meta:
model = Role
include_fk = True

role = ma.auto_field()
role = auto_field()
5 changes: 3 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ flask-redis==0.4.0
# via
# -r requirements.txt
# funding-service-design-utils
flask-sqlalchemy==3.0.3
flask-sqlalchemy==3.1.1
# via
# -r requirements.txt
# flask-migrate
Expand Down Expand Up @@ -409,7 +409,7 @@ soupsieve==2.4.1
# via
# -r requirements.txt
# beautifulsoup4
sqlalchemy==1.4.44
sqlalchemy==2.0.24
# via
# -r requirements.txt
# alembic
Expand Down Expand Up @@ -441,6 +441,7 @@ typing-extensions==4.4.0
# alembic
# alembic-utils
# flupy
# sqlalchemy
urllib3==1.26.18
# via
# -r requirements.txt
Expand Down
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ flask-migrate==4.0.5
# funding-service-design-utils
flask-redis==0.4.0
# via funding-service-design-utils
flask-sqlalchemy==3.0.3
flask-sqlalchemy==3.1.1
# via
# -r requirements.in
# flask-migrate
Expand Down Expand Up @@ -222,9 +222,7 @@ s3transfer==0.6.1
semver==2.13.0
# via prance
sentry-sdk[flask]==1.31.0
# via
# funding-service-design-utils
# sentry-sdk
# via funding-service-design-utils
shortuuid==1.0.11
# via -r requirements.in
six==1.16.0
Expand All @@ -237,7 +235,7 @@ six==1.16.0
# thrift
soupsieve==2.4.1
# via beautifulsoup4
sqlalchemy==1.4.44
sqlalchemy==2.0.24
# via
# -r requirements.in
# alembic
Expand All @@ -258,6 +256,7 @@ typing-extensions==4.4.0
# alembic
# alembic-utils
# flupy
# sqlalchemy
urllib3==1.26.18
# via
# botocore
Expand Down

0 comments on commit 2f3db2a

Please sign in to comment.