Skip to content
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

Possible bug in Autosubmit.copy_as_config due to wrong argument type #2085

Open
kinow opened this issue Jan 29, 2025 · 0 comments · May be fixed by #2098
Open

Possible bug in Autosubmit.copy_as_config due to wrong argument type #2085

kinow opened this issue Jan 29, 2025 · 0 comments · May be fixed by #2098
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@kinow
Copy link
Member

kinow commented Jan 29, 2025

Not sure if that function is used, I am in the middle of a review for @VindeeR BSC-ES/autosubmit-config-parser#66 when I saw that a function that Erick was changing could also have types added.

Doing so, I saw some warnings, and following them I saw these lines in the Autosubmit code:

AutosubmitConfig.ini_to_yaml(os.path.join(BasicConfig.LOCAL_ROOT_DIR, exp_id,"conf"),
os.path.join(BasicConfig.LOCAL_ROOT_DIR, exp_id,"conf",conf_file.replace(copy_id,exp_id)))

Image

Note that the first argument to ini_to_yaml is the result of join, which is a string.

While in the Autosubmit Config Parser we have:

https://github.com/BSC-ES/autosubmit-config-parser/blob/169b1eb48eeb494a760a0d4d685d7e756b48a701/autosubmitconfigparser/config/configcommon.py#L2505C21-L2519

Image

I intentionally cut the code where the root_dir (expected to be a Path via type hints) is used with /. That won't work if a string is passed, as Autosubmit is doing.

My IDE found other usages fo ini_to_yaml and those were correctly passing a Path. My guess is that either that code is not used by users, or just not used at all. So we need to either fix it, or delete if the code is not accessible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants