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

str(GitTransportRI) broken, and with it _get_flexible_source_candidates() #7570

Open
mih opened this issue Mar 13, 2024 · 0 comments
Open

str(GitTransportRI) broken, and with it _get_flexible_source_candidates() #7570

mih opened this issue Mar 13, 2024 · 0 comments

Comments

@mih
Copy link
Member

mih commented Mar 13, 2024

This has been reported in the office hour. There is a super subdataset configuration, where the superdataset was cloned from a datalad-annex:: URL. Worked fine.

Now getting a subdataset fails, because a generated candidate URL is exactly the same as the superdataset remote URL.

Here is where it happens:

> /home/mih/env/datalad-dev/lib/python3.11/site-packages/datalad/distribution/utils.py(74)_get_flexible_source_candidates()
-> src = str(ri)
(Pdb) p ri
GitTransportRI(RI='file:///tmp/julia/demo_micro_datalad/newstore/QC/B31_4318-datalad?type=external&externaltype=uncurl&encryption=none&url={noquery}/{{annex_key}}', path='inputs/se4318', transport='datalad-annex')
(Pdb) p str(ri)
'datalad-annex::file:///tmp/julia/demo_micro_datalad/newstore/QC/B31_4318-datalad?type=external&externaltype=uncurl&encryption=none&url={noquery}/{{annex_key}}'

str(ri) simply ignores the fact that there is a path='inputs/se4318'.

Where other code layers should catch the resulting fall-out, generating such a candidate URL makes no sense to begin with.

I believe what should have been generated is

datalad-annex::file:///tmp/julia/demo_micro_datalad/newstore/QC/B31_4318-datalad/inputs/se4318?type=external&externaltype=uncurl&encryption=none&url={noquery}/{{annex_key}}

@mih mih changed the title _get_flexible_source_candidates cannot deal with GitTransportRI str(GitTransportRI) broken, and with it _get_flexible_source_candidates() Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant