9,712
questions
0
votes
0
answers
16
views
Selecting a course from the dropdown menu of a form, return alwys None
I am developing a web app in Flask where teachers can upload some exercises, but only for their teaching courses. However, whatever course I select, I always get the flash message "Course None ...
1
vote
0
answers
20
views
In Apache Superset issue with use of Jinja parameters
I am creating a dataset via sql lab, in this I wrote a query with a parameter. When I am running this query in SQL lab its working fine, but when I start creating chart by using this dataset, it ...
-1
votes
1
answer
78
views
Evaluate a Jinja2 string as template in Ansible
I have a sort of configuration vars file through which I'm looping,
checks:
- name: "x"
setting: "y"
eval: "{{ 'OK' if var == 'x' else 'NOK' }}"
main.yml
- ...
1
vote
1
answer
40
views
Is it possible to template the parameters of Ansible's uri module with Jinja2?
I am just wondering whether it's possible to use jinja2 template within URI module.
I have tried something like this:
- name: update checkpoint members asset field
uri: |
[{% for item in ...
0
votes
0
answers
23
views
HTML Jinja2 for loop not showing the items on my postgresql+python flask web app
I'm trying to make a simple web app. On the frontpage, I want to show the top 10 restaurants in order by their average rating, but I've failed to do so. The database query gives me the correct table ...
1
vote
2
answers
48
views
Ansible : strange jinja2 behaviour with lowercase
can anyone explain the following Jinja behaviour in Ansible?
The following code works: The task is skipped because the job_function is not in the exclusion_functions array
- name: Lowercase test
...
0
votes
1
answer
19
views
TemplateSyntaxError jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'result1'
I am trying to implement an application for comparison. There is a method as you can see below in the method. get_site_analysis
@app.route('/comparison/<site_id1>/<site_id2>', methods=['...
-1
votes
1
answer
41
views
How do i get jinja2 to recognize the placeholders ( eg. '{{var}}' ) in a html file
I've chosen to make a flight management system program, along with a few other students. My part is to ensure, that for some input key:value pairs in a dictionary, the values should be displayed in ...
0
votes
3
answers
58
views
Get a list of users with UID > 14000 - string to int conversion
In my playbook I want to get a list of all local users with UI above 14000
I used ansible.builtin.slurp on /etc/passwd or ansible.builtin.getent but the real issue is the UID value that I get is ...
0
votes
0
answers
31
views
How to apply a .css style to a div tag with air flight board effect
I have the following "div" in HTML,
<div id="random_decimal" class="departure-board">
{{ x }}
</div>
Even though the departure-board class is applied to ...
1
vote
2
answers
65
views
Ansible Jinja2 Template dict in dict
I want to template php.ini configs for apache2 and cli. I filtered out the default options and added them to a dictionary like this:
php_config_options:
cli:
engine: "On"
...
0
votes
1
answer
45
views
Why running fire shows a documentation?
Let's reproduce this with a simple script
import pandas as pd
import fire
def nada():
data = {
"calories": [420, 380, 390],
"duration": [50, 40, 45]
}
#...
0
votes
0
answers
24
views
Iterating in SQL (Redshift) through jinja in a dbt model
I have an sql model which only needs to recalculate some of it's data.
Ex: for cols with date and cost, I need to update cost for August with all records till July End
and to update costs for July ...
0
votes
0
answers
16
views
Why is an empty string returned by Airflow Jinjia template recognized as true value?
I have got the following DAG. Trying to get a param by template, and do some operation depending on whether it is empty.
with DAG(
'tutorial',
start_date= dates.days_ago(1),
params={
...
1
vote
1
answer
36
views
dbt Incremental Model Not Finishing (Large Dataset)
I'm working with a large dataset (50 tables) that gets updated regularly, and I'm trying to use incremental models in dbt. However, when I run dbt run in "incremental mode," the process ...
-1
votes
0
answers
17
views
Jinja variable include
I'm trying something like this in jinja.
{% include {{form_template}} ignore missing %}
So an include that does depends on some variable form_template. This is apparently now allowed.
How can I ...
0
votes
1
answer
43
views
How can I show my Image in my web site using django
I tried to show an image on my web, which I uploaded from the admin panel hand by using Django.
I was expecting to see my image on the web site, but instead it only showed the little img icon, and ...
0
votes
0
answers
34
views
Iterate files in a folder using dbt and jinja
I would like to iterate through a folder in one of my macros in dbt. Just retriving file names in an array (or any structure) is enough.
Is such thing possible using jinja?
Of all things I tried it ...
-1
votes
0
answers
34
views
How can I render an HTML template using Flask?
I have the script below:
from flask import Flask, render_template
from markupsafe import escape
app = Flask(__name__,template_folder='templates')
@app.route('/')
def hello_world():
return "...
0
votes
0
answers
18
views
DBT calling macro as a post_hook where the macro uses variable from the table
I have a model called stg_dates which compiles a list of dates and reference_id that a call procedure (in snowflake) runs through to preform some calculations.
I have this set-up as:
run_dates.sql
{{ ...
0
votes
1
answer
42
views
Iterate through form elements returned to python
I have a form that is populated with a list of image files that the user can delete. When the form is created, a Jinja loop iterates through the list of photo files and provides a preview of the image ...
0
votes
0
answers
17
views
Jinja Template not rendering using if checks in for loop [duplicate]
i have a jinga template like below:
<span>Holiday Quote Includes</span> {% set rendered_bits = [] %}
<div class="flex fontWeight400 tour_includes-items">
{% ...
1
vote
1
answer
39
views
Flask with pywebview cannot find templates
I'm running a properly working Flask website.
Templates are in the proper location /templates
When adding python webview (https://pywebview.flowrl.com/), like:
app = Flask(__name__)
webview....
0
votes
0
answers
33
views
Trigger FlinkDeployment on K8s using Airflow's FlinkKubernetesOperator
I have a Batch execution mode Flink job that i want to trigger with Airflow, using the Airflow's FlinkKubernetesOperator.
I'm using Airflow on kubernetes (Azure) version 2.9.3
Flink veriosn is 1.17
On ...
0
votes
1
answer
58
views
Ansible: Combining dict into specific list item, nested in a dict
I have defined a main playbook, which calls another preparation playbook via import_playbook.
The preparation playbook returns credentials for an S3 repository, var is called "service_secrets&...
0
votes
1
answer
31
views
How can I reference a sceptre/cloudformation parameter in a jinja2 template
I have a parameter defined in my sceptre config file that I would like to reference in a Jinja2 conditional block.
config/codepipeline.yaml
template:
path: 'codepipeline.yaml.j2'
parameters:
Mode:...
1
vote
1
answer
47
views
Select items in list where attribute does *not* match regex pattern
I have a list of dicts, something like:
[
{
"url": "bucket.amazonaws.com",
"file": "file1.txt"
},
{
"url": "github.com",
...
0
votes
1
answer
13
views
How to use jinja2/html to convert a numpy.arr int to htlm
I may be a bit confusing on how to handle a numpy.arr int table to html/jinja2
In my python app I set the variable to contingency table
the table is original
contingency_table=np.zeros((6,6), dtype=...
0
votes
0
answers
19
views
How to run a workflow in the text/markdown field in Rewst?
I was working in Rewst today and would like to display all of the results of a workflow in a text/markup. So far in my form the user selects the distribution list -> selects if they want to add/...
0
votes
1
answer
51
views
Installing one version of jinja2 module but Jupyter notebook shows a different one
I am trying to run Llama 3.1 8b model through huggingface. After completing all the steps I got this error
ImportError: apply_chat_template requires jinja2>=3.1.0 to be installed. Your version is 3....
-1
votes
0
answers
29
views
I'm getting "jinja2.exceptions.TemplateSyntaxError: unexpected char '$' at 3607" error while trying to render html using js and data from python
I'm trying to use data retrieved by my Python get_data() API to create dynamic URLs. The data is a dictionary which states whether or not a user owns a specific course. If they own the course (Ex. ...
0
votes
0
answers
39
views
How to remove labels from the chart made with Chart.js on the print screen?
I'm using Chart.js for some charts and I’ve run into a bit of an issue. I’ve got these neat comparisons set up, but I need the unselected ones to not show up on the printout. Any ideas on how to do ...
0
votes
0
answers
35
views
My Airflow can't detect my Jinja Template
i want to connect my query to my json file using jinja template
and i got an error in my airflow
it said "jinja2.exceptions.TemplateNotFound: /configuration/query.sql"
this my code
...
-1
votes
0
answers
29
views
How to remove unwanted whitespace in jinja and add ,
I want to remove the space between name and class plus I want to add a , after class if rollnumber is valid. I am converting it into json format from jinja template.
{
{% set student_name = helper....
0
votes
0
answers
23
views
How to access data passed to jinija template from the webpage using javascript
I am passing a python list that contains two lists within it to a template. The code is as follows:
return render_template("result.html", result=pythonList)
where pythonList follows the ...
0
votes
1
answer
17
views
Why I can't save dataset with Jinja variables?
Why I cant save dataset with Jinja variables?
I've edited superset_config.py:
FEATURE_FLAGS = {
"ALERT_REPORTS": True,
"ENABLE_TEMPLATE_PROCESSING": True
}
I can ...
0
votes
1
answer
48
views
How to use django/jinja tags to extend an html with a javascript snippet from another .js file [duplicate]
I am developing a django app.
There is a file templates/index.html file having some javascript snippets at its footer, such as
...
</body>
</html>
<script src="https://unpkg.com/...
0
votes
0
answers
29
views
DBT - 'bool' object is not callable
I'm trying to add a test to a dbt model. However there's an error while running dbt test. I tried to strip down the test to a minimal but still couldn't find where the problem is. The error says
...
0
votes
0
answers
13
views
how to get jinja formatter working in vs code or Pycharm?
I am working on flask project where the template engine is jinja. For past few weeks, I am having a horrible experience with Jinja HTML file formatting. I can track start and ending tag and that is ...
1
vote
2
answers
56
views
TemplateSyntaxError Could not parse the remainder
I have this bit of jinja2 in my Django template:
{% for filesystem, total_quota, total_usage, df_usage in totals_by_filesystem %}
<tr>
<td>{{ filesystem }}</span></td>
...
0
votes
0
answers
13
views
I want to parametrize my pipeline.yaml file but Ploomber can not read my env.yaml file
I use poetry.It's in a directory. Then a subdirectory(named "src") were created and Ploomber worked normal in this subdirectory loading correct its files.
But when I created a second ...
0
votes
1
answer
36
views
How to update a list of dicts keys' value in jinja2
I have set the dicts' keys domain to an empty string "". I am checking if the var field for dict key ssluser is defined, and if so, I then need to fill in the email domain key data extracted ...
0
votes
0
answers
23
views
Issue with dynamic rendering of value between the string along with printing templated strings in yaml using Jinja
Currently we have a yaml file and rendering is done using jinja2 templating. When trying to dynamically update the env value between the string in yaml config returns always different errors and ...
0
votes
1
answer
26
views
Jinja2 template rendering duplicate body / SMTP email sending twice
I created a relatively simple emailer class in python with the intention of reading in a CSV file and filling in a Jinja2 template with dynamic information from the CSV and then sending out emails for ...
0
votes
1
answer
41
views
Manipulating data in Ansible
My vm_info is below.
ok: [localhost] => {
"vm_info": {
"results": [
{
"item": "AP",
"vms": [
{
...
1
vote
1
answer
30
views
Manipulate string in DBT's macro with Jinja2
I am trying to create a dbt macro that can load a table from the macro's arguments. I can do it when I specify input directly, e.g.: ref('data_categories') (data_categories is a real table name). ...
0
votes
1
answer
166
views
DBT - Forcing dependencies dynamically using dbt_utils.get_column_values()
I have a set of 35 models corresponding to objects of different types in my staging layer which I union in my intermediate layer. For the sake of this post I have replaced the data source that I am ...
0
votes
1
answer
105
views
How do i automate a gitlab runner setup using ansible?
Problem:
I'm working on an Ansible playbook to manage GitLab Runner registration and configuration. The playbook should:
Register a GitLab Runner and extract its token and ID.
Template a config file ...
1
vote
1
answer
163
views
Create a Sql Statement IN DBT macro and use the query in the dbt model
my_macro.sql
{macro my_macro(value)}
{% set query %}
select A from value
{{ return(query) }}
{% endset %}
{% endmacro %}
model.sql
select * from B
where A in ({{ my_macro(value) }}
when i ...
0
votes
1
answer
75
views
500:Internal server error when opening JupyterLab (4.0.11) via Anaconda (2.6.1)
I have been using JupyterLab w/ Anaconda for a while now and have not run into this issue before, but now when I open JupyterLab (4.0.11) from Anaconda, it throws an error "500 : Internal Server ...