You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "nailo2c (via GitHub)" <gi...@apache.org> on 2025/10/27 23:05:57 UTC
[PR] Format multiline config values with indentation in AirflowConfigParser [airflow]
nailo2c opened a new pull request, #57388:
URL: https://github.com/apache/airflow/pull/57388
Related: #57355
# Why
The code here doesn't handle indentation and leads to a `configparser.ParsingError`.
https://github.com/apache/airflow/blob/8695fc533d5efd07952a670cafbb0f120639d0ba/airflow-core/src/airflow/configuration.py#L592-L593
# How
Add indentation when the value contains `\n`.
# What
The output is shown below:
```console
root@177f2f0ad9ed:/opt/airflow# airflow config list --include-descriptions --include-examples | grep "dag_bundle_config_list" -A 10
/opt/airflow/airflow-core/src/airflow/dag_processing/dagbag.py:40 DeprecationWarning: airflow.exceptions.AirflowDagCycleException is deprecated. Use airflow.sdk.exceptions.AirflowDagCycleException instead.
# Example: dag_bundle_config_list = [
# {
# "name": "my-git-repo",
# "classpath": "airflow.providers.git.bundles.git.GitDagBundle",
# "kwargs": {
# "subdir": "dags",
# "tracking_ref": "main",
# "refresh_interval": 0
# }
# }
# ]
dag_bundle_config_list = [
{
"name": "dags-folder",
"classpath": "airflow.dag_processing.bundles.local.LocalDagBundle",
"kwargs": {}
}
]
# How often (in seconds) to refresh, or look for new files, in a DAG bundle.
refresh_interval = 300
```
I think we don't need modify it like a JSON-style indenting here, because [configparser](https://docs.python.org/3/library/configparser.html) only checks the INI structure.
Validation (no errors):
```console
root@177f2f0ad9ed:/opt/airflow# python - <<'PY'
import configparser, pathlib, sys
p = configparser.ConfigParser()
p.read(pathlib.Path("airflow_new.cfg"))
PY
root@177f2f0ad9ed:/opt/airflow#
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Format multiline config values with indentation in AirflowConfigParser [airflow]
Posted by "nailo2c (via GitHub)" <gi...@apache.org>.
nailo2c closed pull request #57388: Format multiline config values with indentation in AirflowConfigParser
URL: https://github.com/apache/airflow/pull/57388
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org