You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/01/28 17:03:56 UTC

[GitHub] kartikshanbhag3333 opened a new issue #6771: [Design]Jinja2 support in Markup Viz

kartikshanbhag3333 opened a new issue #6771: [Design]Jinja2 support in Markup Viz
URL: https://github.com/apache/incubator-superset/issues/6771
 
 
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
     http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   
   ### Superset version
   0.28.1
   
   ### Expected results
   Jinja2 Templating in Markup Viz
   ### Actual results
   ![image](https://user-images.githubusercontent.com/11050610/51852237-a9cfd480-234b-11e9-9a52-4964f563da0f.png)
   
   ### Steps to reproduce
   
       def query_obj(self):
           return None
   
       def get_df(self, query_obj=None):
           return None
   
       def get_data(self, df):
           markup_type = self.form_data.get('markup_type')
           code = self.form_data.get('code', '')
           if markup_type == 'markdown':
               code = markdown(code)
               return dict(html=code, theme_css=get_css_manifest_files('theme'))
           else:
               print(template_processor.context["current_username"]())
               return dict(
                   html=jinja2.Environment().from_string(code).render(template_processor=template_processor),
                   theme_css=get_css_manifest_files('theme')
               )`
   
   The question here is, how safe is this? **template_processor** is object of **jinja_context.BaseTemplateProcessor**
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org