Alok-kumar-priyadarshi commented on code in PR #61310:
URL: https://github.com/apache/airflow/pull/61310#discussion_r2786526112
##########
scripts/ci/prek/common_prek_utils.py:
##########
@@ -401,7 +401,8 @@ def inner():
When only_top_level = False then returns
['os', 'collections.defaultdict', 'numpy', 'pandas.DataFrame', 'json',
'pathlib.Path', 'pathlib.PurePath']
"""
- root = ast.parse(file_path.read_text(), file_path.name)
+ root = ast.parse(file_path.read_text(encoding="utf-8"), file_path.name)
Review Comment:
Good question.
I added encoding="utf-8" to avoid relying on the system’s default encoding,
which can differ across environments (for example, Windows vs Linux in CI). In
some cases, the default encoding isn’t UTF-8, and that can lead to unexpected
parsing issues if a file contains non-ASCII characters.
By specifying UTF-8 explicitly, we make the behavior consistent and
predictable across platforms and CI environments.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]