In the following ETL query we see the use of double curly brackets.
query_data = """
SELECT {}
FROM {}
WHERE '{{}}'
ORDER BY '{{}}'
"""
Normally, one uses a single pair of bracket with format to customize a string. So, I'm wondering which functionality carries using single or multiple curly brackets for formatting a string?.
The number of curly brackets that we're going to use depends on the number of times that we're going to be formatting a string. In your example, for the first time we're formatting the query we use the single brackets as follows:
Now, for the second time we format
Which should render the following string
However, if you're formatting three or more times you're string, managing the number of curly brackets becomes untractable because you need 2^(n-1) number of curly brackets for each n-time you're formatting. Let's illustrate this through an example
Should render the following output