-
Notifications
You must be signed in to change notification settings - Fork 5
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
#[UIC-1885] User should able to replicate dashboard via a REST Call #224
Conversation
UIC-1905 #time 4h API creation and verification
UIC-1904 #time 30m Knox rule and son encoding handling
UIC-1904 #time 10m remove unneeded API
superset/views/core.py
Outdated
database_id = create_database(database_name,sqlalchemy_uri,extra,impersonate_user) | ||
|
||
dashboard_title = request.form.get('dashboard_title') | ||
tablesparam = json.loads(r''+request.form.get('tables')) |
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.
Please replace tablesparam
with tables_param
to make it more readable.
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.
Sure will do
def import_dashboard_json(session, data, import_time=None): | ||
current_tt = int(time.time()) | ||
import_time = current_tt if import_time is None else import_time | ||
dashboard = data['dashboards'][0] |
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.
is there any key with which we can retrieve the value here or has it to be on 0th index always?
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.
This is array we can iterate but as mentioned we are only supporting single dashboard at this point of time.
There will more changes than just iteration we need to take care (rest API signature will change). Hence will differ it till a ask come or we hit a persuasive usecase
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.
LGTM
* feat(replicate-dashboard): added code for replicate dashboard * feat(replicate-dashboard): rename and text fix * feat(replicate-dashboard): Knox rule and json encoding handling * feat(replicate-dashboard): remove unneeded API * feat(replicate-dashboard): review comment
CATEGORY
Choose one
SUMMARY
Exposed a
replicate_dashboard
endpoint to replicate a dashboard from a given JSON template.REST API Details:
superset/replicate_dashboard
none
name of database to be created
uri for database connection as per sqlalchemy spec
additional configuration to establish connection via sqlalchemy_uri
True | False
case sensitivetitle of dashboard to be created
A map of tableplachoder as key and schema.table_name as value
template json to be imported
token received from /superset/csrf_token/ endpoint to avoid CSRF attack
Template JSON: User can create a template json by following steps
datasources
from the JSON. In case you won't remove it will be ignoreddatasource_name
withtableplachoder
. Wheretableplachoder
is key intables
parameter corresponding todatasource
to be used in this slicePOSTMAN: https://www.getpostman.com/collections/f1e82aece15702b7dc3a
Expectation & Limitations
Feature set
Limitation
TEST PLAN
ADDITIONAL INFORMATION
REVIEWERS
@jitendra-kumawat