### Apache Airflow Provider(s)

common-sql

### Versions of Apache Airflow Providers

apache-airflow-providers-common-sql==1.3.1

### Apache Airflow version

2.5.0

### Operating System

Debian GNU/Linux 11 (bullseye)

### Deployment

Other Docker-based deployment

### Deployment details

Docker image based on the official image (couple of tools added) deployed on AWS ECS Fargate

### What happened

I have a task which uses the table check operator to run some table stakes data validation.  But I don't want it failing every time it runs in our test environments which do not get records every day.  So there's a templated switch in the sql:

```python
    test_data_changed_yesterday = SQLTableCheckOperator(
        task_id="test_data_changed_yesterday",
        table="reporting.events",
        conn_id="pg_conn",
        checks={"changed_record_count": {"check_statement": "count(*) > 0"}},
        partition_clause="""
        {% if var.value.get('is_test_env', False) %}
        modifieddate >= '2015-12-01T01:01:01.000Z'
        {% else %}
        modifieddate >= '{{ data_interval_start.isoformat() }}' and
            modifieddate < '{{ data_interval_end.isoformat() }}'
        {% endif %}
        """,
    )
```

This shows correctly in the rendered field for the task. Not pretty, but it works:

```
('\n'
 '        \n'
 "        modifieddate >= '2015-12-01T01:01:01.000Z'\n"
 '        \n'
 '        ')
```

However, in the logs I see it's running this query:

```
[2022-12-07, 11:49:34 UTC] {sql.py:364} INFO - Running statement: SELECT check_name, check_result FROM (
    SELECT 'changed_record_count' AS check_name, MIN(changed_record_count) AS check_result
    FROM (SELECT CASE WHEN count(*) > 0 THEN 1 ELSE 0 END AS changed_record_count
          FROM reporting.events WHERE 
        {% if var.value.get('is_test_env', False) %}
        modifieddate >= '2015-12-01T01:01:01.000Z'
        {% else %}
        modifieddate >= '{{ data_interval_start.isoformat() }}' and
            modifieddate < '{{ data_interval_end.isoformat() }}'
        {% endif %}
        ) AS sq
    ) AS check_table, parameters: None
```

Which unsurprisingly the DB rejects as invalid sql!

### What you think should happen instead

The rendered code should be used in the sql which is run!

I think this error comes about through this line: https://github.com/apache/airflow/blob/main/airflow/providers/common/sql/operators/sql.py#L576 which is run in the `__init__` method of the operator. i.e. before templating is applied in the build up to calling `execute(context)`.

### How to reproduce

Use the operator with a templated `partition_clause`

### Anything else

Happens every time

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

if self.retry_on_failure:
            raise AirflowException(exception_string)
        raise AirflowFailException(exception_string)
class SQLExecuteQueryOperator(BaseSQLOperator):
    """
    Executes SQL code in a specific database
    :param sql: the SQL code or string pointing to a template file to be executed (templated).
    File must have a '.sql' extensions.
    When implementing a specific Operator, you can also implement `_process_output` method in the
    hook to perform additional processing of values returned by the DB Hook of yours. For example, you
    can join description retrieved from the cursors of your statements with returned values, or save
    the output of your operator to a file.
    :param autocommit: (optional) if True, each command is automatically committed (default: False).
    :param parameters: (optional) the parameters to render the SQL query with.
    :param handler: (optional) the function that will be applied to the cursor (default: fetch_all_handler).
    :param split_statements: (optional) if split single SQL string into statements (default: False).
    :param return_last: (optional) return the result of only last statement (default: True).
    .. seealso::
        For more information on how to use this operator, take a look at the guide:
        :ref:`howto/operator:SQLExecuteQueryOperator`
    """
    template_fields: Sequence[str] = ("sql", "parameters")
    template_ext: Sequence[str] = (".sql", ".json")
    template_fields_renderers = {"sql": "sql", "parameters": "json"}
    ui_color = "#cdaaed"
    def __init__(