Skip to content

Include extra data in Meta in _meta #1328

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

Closed

Conversation

adrianschneider94
Copy link

@adrianschneider94 adrianschneider94 commented Apr 21, 2021

I'm building an authorization middleware and I want to include functions/data in the Meta class to store the relevant information in the class itself.
However, all custom args in Meta are dropped at the moment.
I think there shouldn't be an issue to include other args in an extra attribute of _meta.

@adrianschneider94
Copy link
Author

Hey, could anyone have a look on this?
It's a very tiny change and does not break anything...

@adrianschneider94
Copy link
Author

Now the tests are broken... I have no idea, why...

@codecov
Copy link

codecov bot commented Aug 27, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.45%. Comparing base (355601b) to head (bc73823).
Report is 73 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1328   +/-   ##
=======================================
  Coverage   95.44%   95.45%           
=======================================
  Files          49       49           
  Lines        1582     1583    +1     
=======================================
+ Hits         1510     1511    +1     
  Misses         72       72           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -43,6 +43,7 @@ def __init_subclass_with_meta__(
return
_meta.name = name or cls.__name__
_meta.description = description or trim_docstring(cls.__doc__)
_meta.extra = _kwargs
Copy link
Member

@erikwrede erikwrede Aug 27, 2022

Choose a reason for hiding this comment

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

I think the extra field should be an explicit class attribute of the BaseOptions class so that it can be properly documented. Otherwise users will be confused about the meaning or the purpose/won't find it at all. LMK what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants