-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Add extra
column to SavedQuery
#6687
Conversation
@@ -75,6 +75,9 @@ def pre_update(self, obj): | |||
|
|||
|
|||
class SavedQueryViewApi(SavedQueryView): | |||
list_columns = [ | |||
'label', 'sqlalchemy_uri', 'user_email', 'schema', 'description', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need sqlalchemy_uri
and user_email
in the list view, how about the database name and user name in instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. The reason I'm exposing this is for Airflow, so it can schedule queries. In that case, having the email is better, since the username in our case comes from the Google auth. The SQLAlchemy URI also gives more info than just the DB name. But if you think it makes sense to return username and database name I can do the mapping in Airflow instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh actually I didn't realized this is SavedQueryViewApi
and not just SavedQueryView
, it's totally good/fine to add it here. I thought this would affect the list view that users see...
superset/migrations/versions/a33a03f16c4a_add_extra_column_to_savedquery.py
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #6687 +/- ##
==========================================
- Coverage 56.22% 56.19% -0.03%
==========================================
Files 519 520 +1
Lines 23098 23186 +88
Branches 2759 2765 +6
==========================================
+ Hits 12986 13030 +44
- Misses 9702 9746 +44
Partials 410 410
Continue to review full report at Codecov.
|
* Expose more columns in saved queries API * Add extra column to SavedQuery * Add ASF header (cherry picked from commit 31ea681)
* Expose more columns in saved queries API * Add extra column to SavedQuery * Add ASF header (cherry picked from commit 31ea681)
* Expose more columns in saved queries API * Add extra column to SavedQuery * Add ASF header (cherry picked from commit 31ea681)
* Expose more columns in saved queries API * Add extra column to SavedQuery * Add ASF header (cherry picked from commit 31ea681) (cherry picked from commit 764becaad6cf4d157c6fcba43a681d9768cf266b)
Similar to #6112, this PR adds an
extra
column toSavedQuery
.Note that this PR depends on #6686, so the extra columns in the API are being shown here.