question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Role joining is not model agnostic

See original GitHub issue

We tried replacing flask-security in our project, however our project’s User model does not have a sqlalchemy relationship for roles, it’s a hybrid_property method on the class.

The changes from https://github.com/jwag956/flask-security/commit/32968e593d2f7c82ed2767b1e0d7927f3edfffaa assumes that if roles is defined as an attribute on the User class that it must be a relationship and thus joinable, which isn’t always a safe assumption.

I’m not sure what the best option here is outside of testing to see if the roles attribute is specifically a sqlalchemy.orm.relationship prior to forcing the relationship to be joined or if in our case we need to not have a roles attribute and override something somewhere on how the datastore gets roles for a user.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pffscommented, Jan 8, 2020

I’ll put in a PR for it here in a bit.

0reactions
jwag956commented, Jan 7, 2020

Yup - easy. Do you want to issue a PR - otherwise I’ll get to it in a few days…

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are Model Agnostic Methods? - Towards Data Science
A model agnostic method can be applied to any model. When using model agnostic methods, after the model has been trained it can...
Read more >
Local Interpretable Model-Agnostic Explanations (LIME)
A technique to explain the predictions of any machine learning classifier.
Read more >
Are important features or noise model agnostic?
Short Answer: Yes and no, depending on what you mean by 'important'. Long Answer: Let's consider using features X:=(x1,…,xd)∈X to predict ...
Read more >
using Local Interpretable Model-Agnostic Explanations (LIME)
We build a classifier to predict whether relationships are going to last, or not, and used Local Interpretable Model-Agnostic Explanations ...
Read more >
Towards Model Agnostic Federated Learning Using ...
The local models may differ in their kernel function so that model averaging is not possible. While the constrained setup limits practical insights,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found