-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fixed config list ouput for multi-line values #58115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed config list ouput for multi-line values #58115
Conversation
|
Why not fixing |
|
the issue is caused by how python's |
|
off the top of me head, i can change this line
into if isinstance(default_value, str):
self.set(section_to_write, option, default_value)
value = self.get(section_to_write, option, raw=True)
else:
value = self.get(section_to_write, option, fallback=default_value, raw=True) |
|
Hi, I think potiuk is right. I fixed root@7da61615e7c7:/opt/airflow# airflow config list --include-descriptions --include-examples | grep "dag_bundle_config_list" -A 10
# 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
root@7da61615e7c7:/opt/airflow#
root@7da61615e7c7:/opt/airflow#
root@7da61615e7c7:/opt/airflow# python - <<'PY'
import configparser, pathlib, sys
p = configparser.ConfigParser()
p.read(pathlib.Path("airflow_new.cfg"))
PY
root@7da61615e7c7:/opt/airflow# |
airflow config list command|
Looks good - I updated the title to reflect it, but it would also be great to edit description of the PR to not be misleading about the change (for posterity) |
|
also rebasing and squashing into a single commit, properly described would be a good thing before we merge it. |
Closes: apache#57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value.
d98aa41 to
8502bdc
Compare
|
Thanks for the review, rebasing and squashing are done 🙌 |
|
Thanks ! |
Backport failed to create: v3-1-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker d009b64 v3-1-testThis should apply the commit to the v3-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
Closes: apache#57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value. (cherry picked from commit d009b64) Co-authored-by: Aaron Chen <nailo2c@gmail.com>
|
Backport in #58378 |
Closes: apache#57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value. (cherry picked from commit d009b64) Co-authored-by: Aaron Chen <nailo2c@gmail.com>
…8378) Closes: #57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value. (cherry picked from commit d009b64) Co-authored-by: Aaron Chen <nailo2c@gmail.com>
…8378) Closes: #57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value. (cherry picked from commit d009b64) Co-authored-by: Aaron Chen <nailo2c@gmail.com>
…8378) Closes: #57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value. (cherry picked from commit d009b64) Co-authored-by: Aaron Chen <nailo2c@gmail.com>
…8378) Closes: #57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value. (cherry picked from commit d009b64) Co-authored-by: Aaron Chen <nailo2c@gmail.com>
…8378) Closes: #57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value. (cherry picked from commit d009b64) Co-authored-by: Aaron Chen <nailo2c@gmail.com>
Closes: apache#57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value.
…8378) Closes: #57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value. (cherry picked from commit d009b64) Co-authored-by: Aaron Chen <nailo2c@gmail.com>
Closes: apache#57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value.
Closes: apache#57355 When a user runs `airflow config list --include-descriptions --include-examples`, multi-line values (like `dag_bundle_config_list`) would cause a `configparser.ParsingError` due to improper indentation. This fix pretty-prints the JSON value using `json.dumps(indent=4)` and then adds an additional four-space indent to each new line. This ensures the INI parser treats the entire block as a single, valid multi-line value.
Closes: #57355
When a user runs
airflow config list --include-descriptions --include-examples,multi-line values (like
dag_bundle_config_list) would cause aconfigparser.ParsingErrordue to improper indentation.This fix pretty-prints the JSON value using
json.dumps(indent=4)and then adds an additional four-space indent to each new line.
This ensures the INI parser treats the entire block as a
single, valid multi-line value.