### 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)

IMPORTANT!!! Keep it for compatibility with released 8.4.0 version of google provider.
Unfortunately the provider used _get_failed_checks and parse_boolean as imports and we should
keep those methods to avoid 8.4.0 version from failing.
"""
_PROVIDERS_MATCHER = re.compile(r"airflow\.providers\.(.*)\.hooks.*")
_MIN_SUPPORTED_PROVIDERS_VERSION = {
    "amazon": "4.1.0",
    "apache.drill": "2.1.0",
    "apache.druid": "3.1.0",
    "apache.hive": "3.1.0",
    "apache.pinot": "3.1.0",
    "databricks": "3.1.0",
    "elasticsearch": "4.1.0",
    "exasol": "3.1.0",
    "google": "8.2.0",
    "jdbc": "3.1.0",
    "mssql": "3.1.0",
    "mysql": "3.1.0",
    "odbc": "3.1.0",
    "oracle": "3.1.0",
    "postgres": "5.1.0",
    "presto": "3.1.0",
    "qubole": "3.1.0",
    "slack": "5.1.0",
    "snowflake": "3.1.0",
    "sqlite": "3.1.0",
    "trino": "3.1.0",
    "vertica": "3.1.0",
}
class BaseSQLOperator(BaseOperator):