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

feat(api): bump marshmallow and FAB to version 3 #9964

Merged
merged 18 commits into from Jul 7, 2020

Conversation

dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented Jun 2, 2020

SUMMARY

Bump Flask-AppBuilder to version 3 that implies marshmallow version 3 that is a major (breaking) release

Marshmallow upgrading to version 3: https://github.com/marshmallow-code/marshmallow/blob/31b784fc24ed637c82d87eac35d1a1bd58851f59/docs/upgrading.rst

FAB 3 changelog:

Improvements and Bug fixes on 3.0.0

BREAKING CHANGES:

Fixes: #10232

ADDITIONAL INFORMATION

@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2020

Codecov Report

Merging #9964 into master will increase coverage by 0.58%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9964      +/-   ##
==========================================
+ Coverage   70.31%   70.90%   +0.58%     
==========================================
  Files         594      404     -190     
  Lines       31608    13108   -18500     
  Branches     3221     3221              
==========================================
- Hits        22225     9294   -12931     
+ Misses       9275     3706    -5569     
  Partials      108      108              
Flag Coverage Δ
#cypress 53.45% <ø> (+0.07%) ⬆️
#javascript 59.44% <ø> (ø)
#python ?
Impacted Files Coverage Δ
superset/db_engine_specs/kylin.py
superset/connectors/druid/__init__.py
superset/db_engines/hive.py
superset/connectors/base/models.py
superset/db_engine_specs/elasticsearch.py
superset/db_engine_specs/mssql.py
superset/views/chart/mixin.py
superset/examples/countries.py
superset/models/datasource_access_request.py
superset/examples/world_bank.py
... and 168 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdd28c1...7e046a8. Read the comment docs.

@dpgaspar dpgaspar marked this pull request as ready for review July 3, 2020 14:52
@villebro villebro added the v0.37 label Jul 3, 2020
@villebro
Copy link
Member

villebro commented Jul 3, 2020

Tagging this as 0.37 due to bugs it fixes in master + to make it easier to cherry pick for patch releases on 0.37 version.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few first pass comments. Looking forward to getting aboard {FAB,marshmallow}3! 👍

Comment on lines 454 to 460
query_context = ChartDataQueryContextSchema().load(json_body)
except KeyError:
return self.response_400(message="Request is incorrect")
except ValidationError as err:
return self.response_400(
_("Request is incorrect: %(error)s", error=err.messages)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is except KeyError still needed here? Based on the docs, load only raises ValidationError in 3.0+: https://marshmallow.readthedocs.io/en/stable/_modules/marshmallow/schema.html#Schema.load

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

superset/charts/schemas.py Outdated Show resolved Hide resolved
Comment on lines 204 to 205
except ValidationError as err:
return self.response_400(message=err.messages)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being picky, but is it more pythonic to assign error as opposed to err? (Applies to other places, too)

Comment on lines 59 to 63
try:
_ = ChartDataQueryContextSchema().load(payload)
except ValidationError as errors:
self.assertIn("row_limit", errors.messages["queries"][0])
self.assertIn("row_offset", errors.messages["queries"][0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this doesn't raise, won't the assertions just be skipped?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@dpgaspar dpgaspar requested a review from villebro July 6, 2020 09:16
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small second pass comments

superset/charts/schemas.py Outdated Show resolved Hide resolved
tests/datasets/api_tests.py Outdated Show resolved Hide resolved
tests/datasets/api_tests.py Outdated Show resolved Hide resolved
@dpgaspar dpgaspar requested a review from villebro July 6, 2020 09:48
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest bumping to latest patch of marshmallow, other than that LGTM 🎉

requirements.txt Outdated Show resolved Hide resolved
@dpgaspar dpgaspar merged commit 878dbcd into apache:master Jul 7, 2020
@dpgaspar dpgaspar deleted the dep/marshmallow3 branch July 7, 2020 12:27
@villebro villebro mentioned this pull request Aug 10, 2020
3 tasks
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* feat(api): bump marshmallow and FAB to version 3

* revert query context tests changes

* obey mypy

* fix tests

* ignore types that collide with marshmallow

* preparing for RC2

* fix tests for marshmallow 3

* typing fixes for marshmallow

* fix tests and black

* fix tests

* bump to RC3 and lint

* Test RC4

* Final 3.0.0

* Address comments, fix tests, better naming, docs

* fix test

* couple of fixes, addressing comments

* bumping marshmallow
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L v0.37 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Welcome page pagination is inconsistent
5 participants